Could not load file or assembly "App_Licenses.dll" " Could not load file or assembly App_Web_"

今天在AspDotNetStorefront做定制化开发,编译的时候莫名其妙地报告Could not load file or assembly 'App_Licenses, Version=0.0.0.0, Culture=neutral, ... (Exception from HRESULT: 0x80070057 (E_INVALIDARG))的错误,检查文件系统,发现文件还在,然后查看文件夹权限,也没有发现任何异样。于是Google。网上很多网友给出解决方案,比如:重启/重装ASP.NET,设置Network Service权限等等,结果无功而返。

后来我发现,不仅仅是这个App_Licenses.dll无法加载,就算我从References中删去这个引用,仍然会提示其它的DLL也无法加载的情况。而且,我重新安装一份新的AspDotNetStorefront应用也出现同样的问题。很明显,不是我解决方案本身的问题。

突然想起之前有过机器异常重启的经历,我估计是在异常重启的过程中造成了文件丢失或者损坏,于是先用iisreset/stop停止IIS服务,然后打开ASP.NET的临时文件夹(在32bit,.NET 2.0中,是),删除所有的文件和文件夹,再iisreset/start后,编译解决方案,一切正常。

这问题其实不复杂,但真正碰到这样的问题解决起来也挺难的。在此随笔一下,也希望能够帮到遇到同样问题的网友。

 

-------------------------------------------------------------------------------

 

如果你的2.0网站不是经过vs2005发不出来的,而是将cs文件和aspx文件一同上传的,可能会引发这个错误,其实是由于framework的临时文件造成的。  

Could Not Load File Or Assembly '...' Or One of Its Dependencies. Access Is Denied.

If you configure an ASP.NET 2.0 web application (or web service) to impersonate a user that is not a member of the Administrators group, and particularly if the application needs to load an assembly from the "bin" folder, then you may receive an HttpException ("Could not load file or assembly '...' or one of its dependencies. Access is denied."). This may happen because the impersonating user is denied write access on the "%systemroot%/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files" folder. You can find more information at the following location.

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaspnetrequiredaccesscontrollistsacls.asp

Could not load file or assembly App_Web_*** ASP.NET

While loading an asp.net web page, it encounters the following error.

Could not load file or assembly 'App_Web_33cq6epw, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

The easy way to figure this out is to shut down IIS (iisreset /stop), then delete the temp asp.net files located in C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files (for .Net framework 2.0), and finally restart IIS (iisreset /start). It should work for you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值