Try setting the processor target to 32 bit.
Where is that setting at? I am using Visual Basic 2008 Express.
In VS, Right click your project. Go to Properties. Under one of the tabs is a setting for Target Processor.
I'm not sure if that will fix it, but it might. I had problems with the Express versions before. Especially with COM stuff.
In VS, right click your project, then click properties. Click Build tab, under Output section, deselect "Register for COM Interop" checkbox. Rebuild again.
If you get the following error:
The assembly DLLFilePath could not be converted to a type library.
Type library exporter encountered an error while processing
'DLLName.DLLName, DLLName'. Error: Element not found.
You have "Register for COM interop" checked under the Compile tab in Visual Studio. There are several things to ensure errors don't occur because of this setting. Keep in mind that all these steps don't pertain specifically to this error and I'm not going to detail why. If you do follow these steps, then you will produce a successful assembly when using COM and registering it with the GAC. The step related mostly to this error is 4.
1) Ensure you sign the assembly with a strong name key pair (sn -k <give the key pair a name>). See the following webpage for details: http://msdn.microsoft.com/en-us/library/6f05ezxy(v=vs.80).aspx
2) The head of your "SwAddin" class should contain something like the following (series of attributes):
3) Turn on "Make assembly COM-Visible" under Assembly Information. Details about how to find the
"Assembly Information" dialog are in step four.
4) If you choose to assign a GUID to your assembly, choose a value different from your classes/interfaces. In other words, the value shown above should not match the one defined under "Assembly Information". This can be found in VS by opening up the project properties and go to the Application tab. On this tab pane you will find the Assembly Information button - click this. The Assembly Information dialog will appear and the GUID should be one of the listed items. Ensure this value is different than all other GUIDs. I cannot stress this enough.