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:
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With