奇怪的.Net无法加载程序集错误 [英] Odd .Net Could Not Load Assembly Error

查看:150
本文介绍了奇怪的.Net无法加载程序集错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个发送电子邮件的超级基本表单。该代码包含在一个虚拟目录中,如 http://url/emailer/emailer.aspx 新服务器并且工作正常。

I have a super basic form that shoots out an email. The code is contained within a virtual directory like http://url/emailer/emailer.aspx on a new server and is working fine.

我们正在将一些其他站点迁移到这个新服务器。为了测试,我通过ip地址访问文件,所以我可以在新服务器上看到像 http:// ip / url / emailer / emailer.aspx

We are in the process of migrating a few additional sites over to this new server. To test, I'm accessing the files via the ip address so I can see the site on the new server like http://ip/url/emailer/emailer.aspx.

出于某种原因,每当我通过IP URL访问aspx页面时,我都会收到 can不加载程序集...确保在访问页面之前编译它错误。但是,我已确认何时进入实际网站,它运行正常。

For some reason, whenever I access the aspx page via the IP URL, I receive the "could not load the assembly...make sure that it is compiled before accessing the page" error. However, I've confirmed when pulled into the live site, it works fine.

为什么引用IP网址会导致此异常?

Why does referencing the IP URL cause this exception?

推荐答案

在IIS中是否正确设置?如果它没有像原始服务器那样设置为应用程序,那么它将在不同的位置查找bin目录。例如,如果您将/ myapp作为目录而不是应用程序,它将在/ bin中查找,但如果您将其更改为应用程序,它将在/ myapp / bin中查找它。

Is it setup correctly in IIS? If it's not set as an application in the same way as the original server then it will be looking for the bin directory in a different location. For example, if you have /myapp as a directory, but not an application it will look in /bin, but if you change it to an application it will look for it in /myapp/bin.

我见过的唯一另一个时间是为2个不同的应用程序指定了相同的应用程序池,每个应用程序池都运行不同版本的框架。听起来这不是你的问题,但是如果还有其他正在使用不同框架版本的ip监听的话,可能值得检查应用程序池标识。

The only other time I've seen this is when the same app pool is specified for 2 different apps, each set to run a different version of the framework. It doesn't sound like this is your problem, but it might be worth checking the app pool identities in case there's something else that's listening on the ip that might be using a different framework version.

这篇关于奇怪的.Net无法加载程序集错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆