繁体   English   中英

ASP.NET Web应用程序:无法读取DLL

[英]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 ,这将使您能够查看所有装配负载故障。

返回基础:使用Fusion Log Viewer调试隐藏的加载程序错误

暂无
暂无

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

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