ASP.NET corrupt assembly “Could not load file or assembly App_Web_*
以下是从overFlow 复制过来的问题
I've read through many of the other questions posted on the same issue, but I still do not understand the cause and how to prevent it from happening.
In my case, this happens on the production server. I get the same error that has been described in other questions, and I resolve it by re-copying the assemblies into the bin directory. They are not even recompiled files, they are the same ones that were in there before - copied in again, and then it starts working without problems.
The weird part of it is that I am using Web Deployment Projects to rename all of my assembly files into folder-based dll's. So folder.dll and folder.subfolder.dll instead of App_Web_jt8nxllz.dll. Yet the error still names the original App_Web_jt8nxllz.dll file.
Deleting the contents of the C:\WINDOWS\Microsoft.NET\Framework[64]\v...\Temporary ASP.NET Files
folder works and is all fine, but does anyone know how to prevent this error from happening? Also, shutting down IIS or restarting it is really not so feasible when it's happening on the production server. Perhaps cleaning out the Temp folder on a scheduler automatically?
What is the real issue here? Is there something in particular that causes this to happen? The site will be humming along no problem at all, and then all of the sudden, one entire folder stops working and produces this error.
Could not load file or assembly 'App_Web_jt8nxllz, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Exception type 'System.IO.FileNotFoundException' was caught.
Source: App_Web_whv5zsvd
Target Site: Void __BuildControlTree(ASP.artists_controls_artistheader_ascx)
Stack Trace:
at ASP.artists_controls_artistheader_ascx.__BuildControlTree(artists_controls_artistheader_ascx __ctrl)
at ASP.artists_controls_artistheader_ascx.FrameworkInitialize()
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.UserControl.InitializeAsUserControl(Page page)
at ASP._artists_artist_master.__BuildControlctlArtistHeader()
at ASP._artists_artist_master.__BuildControlctlContent(Control __ctrl)
at System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container)
at ASP.master_mysite_master.__BuildControlMainContent()
at ASP.master_mysite_master.__BuildControlform1()
at ASP.master_mysite_master.__BuildControlBody()
at ASP.master_mysite_master.__BuildControlTree(master_mysite_master __ctrl)
at ASP.master_mysite_master.FrameworkInitialize()
at System.Web.UI.UserControl.InitializeAsUserControlInternal()
at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.MasterPage.get_Master()
at System.Web.UI.MasterPage.ApplyMasterRecursive(MasterPage master, IList appliedMasterFilePaths)
at System.Web.UI.Page.ApplyMasterPage()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Not to just link up my site but i have run into this issue and i wrote a blog post on the topic. Check it out, it has links to more info on this topic. But to sum it up here are the details:
Problem:
The website is throwing an error trying to load a custom web control. You see in the last release, we added a new custom control to another custom web control that is displayed as needed. Because the outer most/parent control and the new child control are separate controls in source, when the .Net Framework goes to compile one of these two controls and does not recompile the other one at the same time you will have a an out of date file trying to reference the old version of the assembly. The fact that the .Net framework appends a random string to the name of the assembly at compile time the name of the newly compiled file and the previous version of the file cause a file name mismatch and therefore the outer/parent control is looking for a file that no longer exists.
Possible Work Around(s) or Temporary Fixes:
1) By setting the batch property of the compilation tag to false in the web.config file
<compilation debug="false" batch="false" />
2) You can also decrease how often it happens by setting by the numRecompileBeforeAppRestart
property:
<compilation debug="false" numRecompilesBeforeAppRestart="50" />
See the KB Article 934839 for more details
Fixes for the Issue after it has already taken place:
1) Delete temp ASP.Net files (this takes down the site)
2) Force the parent/outter control to recompile, edit and save the code file. This is a better option for a fix than #1 because this does not bring down the website.
My Suggestion:
1) First I think that we should put in place the temporary fix #1 from above, this might prevent all issues in the future and could be the only answer we need.
2) Second I would download and install the 934839 hotfix from Microsoft in the QA environment to verify that it does not cause any problems. After some time of testing the hotfix in QA I would install the hotfix to have a permanent fix for this issue. At this time we could remove the temporary work around #1.
Note: After putting Temp fix #1 I have not had the problem again. I have had this fix in place for over 12 months and all is good!
ASP.NET corrupt assembly “Could not load file or assembly App_Web_*的更多相关文章
- ASP.NET MV3 部署网站 报"Could not load file or assembly ' System.Web.Helpers “ 错的解决方法
转自:http://www.cnblogs.com/taven/archive/2011/08/14/2138077.html 国内很多网站空间都只支持.NET 2.0 和 .NET 3.0 3.5, ...
- (转)ASP.NET MVC4 部署错误 Could not load file or assembly
使用VS2010 测试ASP.NET MVC 4 Web API 在部署时候遇到了问题,发现园友有解决的方式,因此转载. 我的解决方式有两种:使用VS2015将VS2010的项目重新发 ...
- 关于在IISserver上执行asp.net Web程序出现以下 “Could not load file or assembly。。。”问题的
Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, Public ...
- Could not load file or assembly 'MySql.Data.CF,
Could not load file or assembly 'MySql.Data.CF, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c56 ...
- error_Could not load file or assembly
原文链接 Could you be missing the loaded assembly from your configuration file? Ensure you have somethin ...
- Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0 异常处理
在本机开发asp.net .rdlc报表后,部署到本地没有问题. 当把网站发布后部署在IIS上,新电脑上(只安装了.net framwork4.5),提示如下错误: “Could not load f ...
- Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies
Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. API 调用退出异常. (Except ...
- Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft.Build.En
错误具体信息: Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft. ...
- MVC4 部署 could not load file or assembly system.web.http.webhost 或是其它文件出误
自从VS2010发布之后使用它来做开发的程序员越来越多,其中很多人使用了MVC来作为新的开发框架,但是在系统部署的时候我们也遇到诸多问题,因为目前大多数windows服务器采用的还是Windows S ...
随机推荐
- I/O多路复用
为什么要使用I/O多路复用 假设要求你写一个echo-server服务器,它也能对用户从标准输入键入的交互命令做出响应.在这种情况下, 服务器必须响应两个互相独立的I/O事件: 1) 网络客户端发起的 ...
- 代理模式/proxy模式/结构型模式
代理模式proxy 定义 为其他对象提供一种代理,并以控制对这个对象的访问.最简单的理解,买东西都是要去商店的,不会去工厂. java实现三要素 proxy(代理)+subject(接口)+realS ...
- springMVC含文件上传调用ajax无法连接后台
springMVC在使用ajax进行后台传值的时候发现找不到对应的requestMapping(""),无法进入后台,在多次试验后确定是 MultipartFile对象与ajax冲 ...
- 关于在程序中 文件新生成 在用os.system()程序对新生成的文件处理 举个栗子 如下:
print 'save to ',savedir+os.sep+d["FILE_NAME"] ff = open(savedir+os.sep+d[& ...
- [资料分享]Python视频教程(基础篇、进阶篇、项目篇)
Python是一种开放源代码的脚本编程语言,这种脚本语言特别强调开发速度和代码的清晰程度.它可以用来开发各种程序,从简单的脚本任务到复杂的.面向对象的应用程序都有大显身手的地方.Python还被当作一 ...
- JS:call()和apply的区别
每个函数都包含两个非继承而来的方法:call()和apply(); call()方法:参数,第一个是作用域中调用函数(this),其余是参数直接传给函数 扩大作用域,传递参数时,参数必须逐个列出. w ...
- 如何用inno setup打包activex
需要解决三个问题,运行环境检测与安装,按顺序执行安装,activex注册. 运行环境检测与安装 最开始的方法,百度之后,根据网上的搜索的结果,使用了RegQueryDWordValue(HKLM, ' ...
- mac优秀软件介绍
1.首先是office软件: Microsoft_Office_2016_Installer.pkg 然后是一个破解软件 FWMSO2016VLU2.0.dmg_.zip 两个都不可少 2.然后是如果 ...
- Java WebService 简单实例
前言:朋友们开始以下教程前,请先看第五大点的注意事项,以避免不必要的重复操作. 一.准备工作(以下为本实例使用工具) 1.MyEclipse10.7.1 2.JDK 1.6.0_22 二.创建服务端 ...
- 多线程相关------互斥量Mutex
互斥量(Mutex) 互斥量是一个可以处于两态之一的变量:解锁和加锁.只有拥有互斥对象的线程才具有访问资源的权限.并且互斥量可以用于不同进程中的线程的互斥访问. 相关函数: CreateMutex用于 ...