简体   繁体   English

Windows Server 2008上的COM安全性

[英]COM security on Windows Server 2008

I have a .NET library that I'm registering for COM interop. 我有一个正在注册COM互操作的.NET库。 Everything works fine on my machine (windows 7 x64) -- I register the library using regasm and VBScript can run CreateObject just fine. 一切在我的机器上都能正常运行(Windows 7 x64)-我使用regasm注册了库,而VBScript可以正常运行CreateObject。 I unregister it and CreateObject fails. 我取消注册,CreateObject失败。 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. 但是,当我将此完全相同的库放在服务器(Windows Server 2008 x64)上并运行regasm(表示该库已正确注册)时,我无法使VBScript的CreateObject真正起作用。 I keep getting an error 我不断收到错误消息

800A01AD (ActiveX component can't create object) 800A01AD(ActiveX组件无法创建对象)

which is the exact error I get on my local box when I unregister the library from COM. 从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? 我需要检查COM中的vi安全性吗?

There are two versions of Regasm.exe on an x64 machine. x64机器上有两个版本的Regasm.exe。 Sounds like you used the 32-bit version, it only adds registry keys to the 32-bit view of the registry (HKLM\\Software\\Wow6432Node). 听起来您使用的是32位版本,它只会将注册表项添加到注册表的32位视图(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. 为了使其成为在64位模式下运行,你必须注册它的64位代码的代码工作。 And of course your .NET component must not have any dependencies on 32-bit unmanaged code. 当然,您的.NET组件不得对32位非托管代码具有任何依赖关系。

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

Or use the 32-bit version of the vbscript engine. 或使用vbscript引擎的32位版本。

Can you show the full command you are using to register the .dll? 您可以显示用于注册.dll的完整命令吗?

according to the article here : http://www.osmstudios.com/Display.asp?Page=asp_emaildll 根据此处的文章: http : //www.osmstudios.com/Display.asp?Page=asp_emaildll

you should be running the following commands from the command line: 您应该从命令行运行以下命令:

regasm <location of file from the root> /tlb:<name of DLL>.dll 

gacutil -i <location of file from the root>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM