[英]ASP.NET web application: Unable to read DLL
我有一個ASP.NET應用程序,它添加了兩個引用:MapServer和GDAL。 這兩個DLL使用了一堆其他DLL,並且它們都在我的applications /bin
目錄中。
當我在Visual Studio 2010中在我自己的PC上運行應用程序時,運行正常。 當我使用IIS將其上傳到我的Windows 2008服務器時,它會拋出此異常:
Could not load file or assembly 'gdal_csharp' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
通過服務器上的Visual Studio運行應用程序時運行正常。
我甚至嘗試將/bin
目錄添加到PATH環境變量中,然后重新啟動服務器。 雖然沒有運氣。
我的猜測是DLL是一個32位的DLL,你試圖在x64環境中運行。 您可以嘗試將應用程序池設置為僅32位嗎?
更新:這里有一個簡單的說明: http : //help.webcontrolcenter.com/KB/a1114/how-to-enable-a-32-bit-application-pool-in-iis7-dedicatedvps.aspx
您需要在GAC注冊dll: http : //en.wikipedia.org/wiki/Global_Assembly_Cache
如前所述,您可能遺漏了GAC的內容。
要查看發生了什么,您可以嘗試打開Fusion Logging ,這將使您能夠查看所有裝配負載故障。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.