Search code examples
c#.netsecuritywindows-server-2008com-interop

COM security on Windows Server 2008


I have a .NET library that I'm registering for COM interop. Everything works fine on my machine (windows 7 x64) -- I register the library using regasm and VBScript can run CreateObject just fine. I unregister it and CreateObject fails. Just as you'd expect.

However, when I put this exact same library on my server (Windows Server 2008 x64) and run regasm (which says the library was registered correctly), I cannot get VBScript's CreateObject to actually work. I keep getting an error

800A01AD (ActiveX component can't create object)

which is the exact error I get on my local box when I unregister the library from COM.

The only thing I can come up with is that this is a security thing. What do I need to check vis a vi security in COM?


Solution

  • There are two versions of Regasm.exe on an x64 machine. Sounds like you used the 32-bit version, it only adds registry keys to the 32-bit view of the registry (HKLM\Software\Wow6432Node). To make it work for code that runs in 64-bit mode you'll have to also register it for 64-bit code. And of course your .NET component must not have any dependencies on 32-bit unmanaged code.

    The 64-bit version is located in c:\windows\microsoft.net\framework64

    Or use the 32-bit version of the vbscript engine.