次の方法で共有


COM-.NET Interop development? Take care of this thing.

I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application.
One of the errors I got in the process of registering the .NET assembly was
RegAsm : warning RA0000 : No types were registered.

This was baffling!! I had done everything right and spent quite some time figuring out what could have gone wrong... until I had a look at the AssemblyInfo.cs. The ComVisible property for the assembly was set to false!! Or the other option would be make all classes and interfaces in your assembly as ComVisible by using ComVisibleAttribute. To access types in a .NET assembly from COM, this property should be set to true. Once I did it, I was able to successfully register the .NET assembly and consume it in my COM component. Be sure to remember this when developing COM - .NET interop applications!!

Comments

  • Anonymous
    May 12, 2010
    It just saved my time on an issue. Thank you. Atin Agarwal.