ASP.Net FileNotFoundException 在服务器上但不在 VS 中
我在 ASP.Net 应用程序中添加了对 DLL 的引用。这开始导致 BadFileFormatException,因此我将应用程序切换到目标 x86。我现在收到此错误:
System.IO.FileNotFoundException:无法加载文件或程序集“TheDLLThatIReferenced.dll”或其依赖项之一。找不到指定的模块。
有问题的 DLL 既存在于 bin 目录中,也存在于服务器上我的应用程序目录的 bin\x86\Debug 中。当我尝试在 Visual Studio 之外运行我的应用程序时,它运行得很好,但如果我尝试通过互联网访问它,就会收到该错误。
可能是什么原因导致此错误,我该如何纠正它?
I added a reference to a DLL in my ASP.Net app. That started causing a BadFileFormatException, so I switched my app to target x86. I'm now getting this error:
System.IO.FileNotFoundException: Could not load file or assembly 'TheDLLThatIReferenced.dll' or one of its dependencies. The specified module could not be found.
The DLL in question is present in both the bin directory, and in bin\x86\Debug in my app's directory on the server. When I try to run my app out of Visual Studio, it runs just fine, but if I try to hit it via the internet, I get that error.
What might be causing this error, and how can I correct it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每次我看到这种情况时,都会归结为程序集不在服务器上应有的位置。
您是否确认您在服务器上访问的网站实际上指向您正在查看的目录?
Every time I've seen this it has boiled down to the assembly not being where it ought to on the server.
Have you confirmed that the web site you are hitting on the server is actually pointed at the directory you are looking at?
将 validateRequest=false 放在引发 Java.io.FileNotFoundException 的 asp.net 页面上。
put validateRequest=false on asp.net page that is throwing Java.io.FileNotFoundException.