What does “Registration for COM Interoperability” actually do?

What exactly does the option of the VS-project “Registration for COM-interaction” do? Because when I create my library with the option turned on, I can call CreateObject in my library from VBScript. But if I build without it, and then run regasm manually, then CreateObject will fail. So I'm wondering - what is VS2010 doing, what am I not doing?

+49
visual-studio visual-studio-2010 com-interop
Aug 20 '10 at 20:24
source share
1 answer

It does the same as running Regasm.exe with the / tlb and / codebase options. The / codebase option is probably the one you forgot. Regasm likes to assume that you put the DLL in the GAC and generate a warning when you do not. GAC is really a very good way to avoid DLL Hell, always a COM problem. But not suitable for your development machine, you do not want to pollute the GAC when developing and testing code. This only matters on your user machine, which may be subject to multiple versions.

Using the wrong version of Regasm.exe on a 64-bit machine is another way to get into the problem, there are usually 4 versions on your computer. Do not forget to highlight the 32-bit and 64-bit versions (c: \ windows \ microsoft \ framework vs framework64), they write different registry keys. You want to choose one that is compatible with the client application. Using both is also good, .NET code can work in any mode, but rather unusual. And distinguish between version v2.0.50727 (from .NET 2.0 to 3.5SP1) and version 4.0. Choosing the right Visual Studio command line is half the battle.

+49
Aug 20 '10 at 20:34
source share
— -



All Articles