reading/loading stuffs from bin shouldn't cause the web app to restart, are you modifying anything in bin? like database file?also, modifying web.config/global.asax can cause the web app to restart

解决方案 »

  1.   

    reading/loading stuffs from bin shouldn't cause the web app to restartstuffs指哪些啊。我也希望如此啊。我试验的结果,如果一个模块在运行的过程中被载入,也即在运行的过程中改变了某个dll的访问时间,web app就会重起啊。是不是有什么配置方面的问题?还望大家继续出手。
      

  2.   

    另外,可以保证的是,运行过程中bin目录里面所有的dll(只有dll)都不会改变修改时间的,只有访问时间的改变。
      

  3.   

    我怎么就没出现这中情况呢?
    但是我一个解决方案里如果有一个主项目,然后有好几个组件库,然后相互引用,编译的时候会出现另一个过程正在使用dll的问题。。
      

  4.   

    ......那你怎么处理的?停IIS服务编译?那不是很不方便,我这个编译的时候没问题,但是使用时问题大了,问一下各种版本?我是.net 2002 + win2k自带的iis(应该是5吧)
      

  5.   

    没有遇到过,应该不会
    你应该注意引用关系,发布后在每个目录下,一般都有完整的dll,不会出现跨目录调用(应用程序集除外)
      

  6.   

    Why ASP.NET Restarts?
    http://www.dotnetindia.com/2003/10/why_aspnet_rest.html
      

  7.   

    http://expert.csdn.net/Expert/topic/3001/3001257.xml?temp=.2171137
    大家支持一下.
      

  8.   

    思归
    http://www.dotnetindia.com/2003/10/why_aspnet_rest.html
    我连不上,能贴一下吗?
      

  9.   

    Why ASP.NET Restarts?
    Found this link from one of the blogs I was browsing today. This is ASP.NET Forum post by Patrick Y. Ng of MS.This talks about both 1.0 and 1.1This behaviour has been bugging lots of people. ASP.Net will restart its application for various reasons. All these reasons are legitimate, but the side effect is that the application will reset all its cache, application state, and InProc session states. 
    You can detect the restart of application and worker process by using the performance monitor. The counters to monitor are "ASP.NET\Application Restarts" and "ASP.NET\Worker Process Restarts". For worker process restart, ASP.NET will write an entry in the eventlog to explain why (logLevel in controls how often eventlog is written). For application restart, however, in v1 and v1.1 there is no easy way for a customer to figure out why a restart happened. So by listing all reasons for app restart, I hope I can help some customers to understand and avoid the restart. For v1 
    ------ Things that causes application restart: - The max compilation limit is reached (look for numRecompilesBeforeApprestart in machine.config) - Physical application path of the web application has changed. - Change in global.asax or one of the included files - Change in machine.config - Change in web.config in the app root - Change inside bin directory or its subdirs - A directory is renamed to bin, or bin is created - Overwhelming change notifications – too many files are changed too fast in one of content directories – could happen if, for example, files are generated on the fly per request - Change in the code-access security policy file - The settings of various attributes in in machine.config affect the restart/shutdown of the worker process itself. However, if you use Windows 2003, and (by default) you are NOT using IIS5 isolation mode, is ignored. Instead, the settings in "Application Pools" in IIS manager is used. 
    For v1.1 
    -------- 
    The list for v1.1 is the same as v1, with the following new conditions: - User code called HttpRuntime.UnloadAppDomain - Any directory under the web application folder is renamed IIS 6.0 
    -------- 
    If you're using IIS 6.0, and you're not using IIS 5 compatible mode, then aspnet_wp.exe will be replaced by w3svc.exe. You may want to go to IIS Manager, go to Application Pools/DefaultAppPool, and see if any of the parameters on the Recycling and Performance tabs are causing the IIS worker process (w3svc.exe) to shutdown. 
      

  10.   

    思归,再请教一下,我按照文章所说仔细检查了一下,可能出问题的几个地方:
    Web Application假设为MyWebApp,bin目录底下有六个文件
    MyWebApp.dll,DecEntity.dll,DecRules.dll,DecData.dll
    1、如果上述dll为新编译的,是否在第一运行时要生成机器码而导致重起?
    2、上述文件写日志到MyWebApp/log目录下,写入是否会导致重起。
    3、配置文件放在MyWebApp/config目录下,读取是否会导致重起。
    4、据观察,最大可能出问题的地方在于DecEntity.dll,DecRules.dll,DecData.dll三个模块的加载:
       首先,如果用Activator.CreateInstance在MyWebApp.dll中调用DecData.dll,DecRules.dll,在调用结束后一定重起。
       如果在MyWebApp.dll的构造函数中初始化DecRules.dll,则调用DecRules.dll时不会重起,但是在DecRules.dll中调用DecData.dll的地方一定重起。观察的结果表明,如果某个dll没在MyWebApp构造时加载进来,则调用时会改变该dll的访问时间,就会造成重起。这个结论与防毒软件扫描bin目录造成web application重起一致。另外还做过一个试验,在服务中取bin目录下稳健的版本号,或者用FileStream读取bin目录下文件内容,都会造成重起,这些操作都是在MyWebApp中完成的。希望大家继续关注这个问题。