Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: The assembly "c:\MyAssembly.dll" could not be converted to a type library

I'm trying to build my project and I've suddenly started getting the following error when the project builds and the "Register for COM interop" property is ticked.

The assembly "c:\MyAssembly.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'SomeType, MyAssembly'. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: 'OtherType'; component: 'c:\OtherAssembly.dll').

Nobody else on the team gets this error, its just me! Clearly I have done something odd to my machine, however the brute force approach of completely removing / deleting and re-adding everything I could think of made no difference, and so I am resigned to actually understanding this error (what a drag!)

So:

  • What does this error actually mean
  • Where should I look next for additional / more specific diagnostic information on what is wrong?
like image 416
Justin Avatar asked Aug 23 '10 07:08

Justin


2 Answers

I had this problem to. I just did the same, gactutil /u (for the uninstall) and gacutil /i (for the install) and the problem was solved

like image 186
Rommel Manalo Avatar answered Sep 29 '22 00:09

Rommel Manalo


In my case, I had a com exposed dll (I changed the guid) that was registered using regasm. I had to use the following command to un-register the assembly and then I was able to build the project successfully.

c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>regasm /u "C:\some-vs-project\bin\Debug\some-vs-dll.dll"

Also if you changed the GUID you need to make sure your NOT using the same GUID in the assembly.cs that your using in your class. I used the same GUID in both the class declaration and assembly and that causes the same error as well.

like image 41
Shawn Avatar answered Sep 28 '22 23:09

Shawn