2009-08-17 99 views
3

我在64位模式下在Windows 2008 Server x64上运行经典ASP。ADODB在64位版本上运行良好,采用了经典的ASP。我的.NET COM DLL有问题。 我已经创建了一个.NET COM DLL具有这种码作为示例:64位模式下的经典ASP和.NET COM DLL注册问题

using System.Runtime.InteropServices; 
namespace TestNamespace 
{ 
    [Guid("C446E97E-B415-4677-B99E-9644657FC98"), 
    ProgId("TestNamespace.TestClass"), 
    ComVisible(true)] 
    public class TestClass 
    { 
     [ComVisible(true)] 
     public void TestMethod(string s) 
     { 
      //some code that uses System.Messaging to send a message 
     } 
    } 
} 

该DLL被编译所有CPU。在ASP中创建对象并执行方法:

Set test = Server.CreateObject("TestNamespace.TestClass") 
test.TestMethod("test string") 
Set test = Nothing 

我使用RegAsm注册DLL:

%windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /tlb /codebase TestNamespace.dll 

在x86平台的ASP和DLL正在运行良好。

在Windows 2008服务器我已经试过:

  • 编译DLL的x64和使用... \ Framework64 \ V2.0.50727 \ RegAsm.exe
  • 编译为不同的平台和不同放置注册地点,包括GAC
  • 更多

的错误(不同的情况):

  • Microsoft VBScript运行时错误 '800a01ad' Server.CreateObject失败
  • 服务器对象错误ASP 0177:80070002 Server.CreateObject失败
  • 服务器对象错误ASP 0177:800401f3 Server.CreateObject失败
  • 服务器对象错误'ASP 0177:80131040'Server.CreateObject失败

当ASP应用程序池切换到32位模式时,它在Windows 2008 Server x64上工作的唯一方法。但我需要它在64位工作! 我认为问题不在于权限,因为32位工作。

任何人都有经验的ASP和.NET COM都在64位运行的经验?

+0

发现,一切正常,直到System.Messaging用于该方法。为x64平台创建并安装的使用消息的Windows服务在System.Messaging中正常工作。 可能是64位asp.dll进程出现问题。 – 2009-08-18 09:50:58

回答

1

发现,一切正常,直到System.Messaging用于该方法。为x64平台创建并安装的使用消息的Windows服务在System.Messaging中正常工作。可能它是64位asp.dll进程的问题。

1

“但我需要它在64位工作!”为什么?你永远无法将任何32位DLLS加载到64位处理中and you will need to go out of proc if you need to do such communication - 这是你想要的吗?你打算怎么处理你的额外地址空间?

A topical blog post regarding what you're trying to go 64 bit for is this one by Rick Byers

如果你真的相信这是你的时间良好的投资,there's an article here on the internals of 64 bit COM which might help in figuring it out for yourself from first principles.

(我怀有同样的本能去64位ASAP和与所有传统做< 64 bittedness,但有时事情并没有打破。)