2011-04-19 44 views
0

首先,當我進行測試時,它在Visual Studio 2010中正常工作。在ASP.NET中使用32位Delphi dll?

但我試過4以下發布到IIS7在64位的Windows 7,但仍然沒有工作:

1.Visual Studio 2010的發佈 - >構建 - >常規 - >目標平臺:任何CPU

1-A:IIS7:ASP.Net V4.0,使32位應用=假

Error: 
Server Error in '/TestDll' Application. 
-------------------------------------------------------------------------------- 

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) 

1-B:IIS7:ASP.Net V4.0,使32位應用=真

它沒有'噸甚至加載可言, 「Internet Explorer無法顯示該網頁」,並應用程序日誌中得到了應用程序錯誤....

  1. Visual Studio 2010的發佈 - >構建 - >常規 - >平臺目標:86

2-A:IIS7:ASP.Net V4.0,使32位應用=假

集加載跟蹤:下列信息有助於確定程序集 'WebApplicationTest' 不能加載。

=== Pre-bind state information === 
LOG: User = IIS APPPOOL\ASP.NET v4.0 
LOG: DisplayName = WebApplicationTest 
(Partial) 
WRN: Partial binding information was supplied for an assembly: 
WRN: Assembly Name: WebApplicationTest | Domain ID: 7 
WRN: A partial bind occurs when only part of the assembly display name is provided. 
WRN: This might result in the binder loading an incorrect assembly. 
WRN: It is recommended to provide a fully specified textual identity for the assembly, 
WRN: that consists of the simple name, version, culture, and public key token. 
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. 
LOG: Appbase = file:///C:/inetpub/wwwroot/TestDll/ 
LOG: Initial PrivatePath = C:\inetpub\wwwroot\TestDll\bin 
Calling assembly : (Unknown). 

2-B:IIS7:ASP.Net V4.0,使32位應用=真

根本不會再次加載。

嗯..從我研究的唯一方法是強制IIS7在32位過程中運行ASP.NET ...但它似乎不工作,我不知道我做了什麼錯誤.. 。

在此先感謝...

回答

2

這似乎是發生的事情是,當你切換到32位,你無法找到一些其他依賴的32個版本。它似乎在尋找這些其他依賴項的64位版本。

如果你可以安排你所有的DLL和程序集都是32位的,你應該試試。

另一種選擇是使用FreePascal構建64位DLL。這可能會工作,如果接口是普通的舊功能,但我不確定FreePascal可以做COM。

另一個途徑是避免使用Delphi altogther,並使用支持64位的工具,視覺工作室。

+0

其實這個DLL不是我編程的,但我被要求使用它。現在是罰款,我會用我的C#DLL,謝謝。 – King 2011-04-20 19:07:04