无法加载文件或程序集
我有一个使用 Oracle.DataAccess.dll 的 ASP.NET 网站。我的本地计算机的 GAC 中有版本 10.2.0.100 和 1.111.6.0,但开发服务器上只有 10.2.0.100。当我将网站部署到服务器并运行网站时,在网站加载之前我收到此错误:
"Could not load file or assembly 'Oracle.DataAccess, Version=1.111.6.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
我想我需要针对 10.2.0.100 版本构建我的应用程序,但我不知道如何做到这一点。如果我从本地计算机上的 GAC 中删除 1.111.6.0 版本并尝试重建,则会收到上述错误。
我该如何解决这个问题?即使 GAC 中存在该 dll 的多个版本,如何针对某一 dll 进行构建?
I have an ASP.NET website that uses the Oracle.DataAccess.dll. I have version 10.2.0.100 and 1.111.6.0 in the GAC of my local machine, but only 10.2.0.100 on the dev server. When I deploy the website to the server and run the website, I get this error before the website even loads:
"Could not load file or assembly 'Oracle.DataAccess, Version=1.111.6.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
I guess I need to build my app against the 10.2.0.100 version but I don't see how to do that. If I remove the 1.111.6.0 version from the GAC on my LOCAL machine and try to rebuild, I get the error above.
How do I resolve this issue? How do I build against a certain dll even if there are more than one version of that dll in the GAC?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以指定要使用的版本。鲍比找到了我正在寻找的链接,很好的链接。
You can specify a version to use. Bobby found the link I was looking for, nice one.
如果您的服务器是 64 位计算机,请在 IIS 中启用 32 位应用程序的执行。
应用程序池>>高级设置>>启用 32 位应用程序。
If your server is a 64bit machine, enable execution of 32 bit applications in IIS.
Application pools >> Advanced Settings >> Enable 32bit Applications.
查看重定向程序集版本
http://msdn。 microsoft.com/en-us/library/7wd6ex19%28v=vs.71%29.aspx
Look into Redirecting Assembly Versions
http://msdn.microsoft.com/en-us/library/7wd6ex19%28v=vs.71%29.aspx
嗯,当您从“添加引用”对话框中选择引用时,您可以选择您想要的版本...
Mmm, when you select the reference from the Add Reference dialog you can chose witch version do you want ...