2009-08-17 97 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,但有時事情並沒有打破。)