我在本地VS2005下调试都正常,可放到服务器上,一有删除目录的操作,必造成Session丢失,望高人指点迷津啊
解决方案 »
- 在Ligerui中生成的树自带复选框的、他绑定的值是什么、如何获取
- 关于ext的应用,我调试的时候总是提示'this.el'为空或不是对象,请帮忙看看,谢谢
- asp.net 如何做上传进度条
- 急啊!!!!用javascript实现gridview全选的问题
- 刚才下来了 ProMesh 源代码来看看,编译遇到问题。
- 如何向一个excel模板中导入一个dataTable
- 听听开发ASP.NET大家用的是什么开发工具?
- SQL server中Text类型的字段应如何存储?
- 如何通过c#代码获得aspx窗体页的<form>标记的name和id值?
- 请问学习asp.net需要安装哪些东西?
- 在AjaxPanel下实现另存为Excel~>o<~
- ajaxpro的一个问题,关于连续两次用js调用后台函数失败。请高手解答
+++++++++++++++++++++++++++++++++++++
如果你发现session突然无理由的丢失,而当你认真的检查代码并且排除其它常规可能丢失
的可能性时,你可能会像我一样,几乎要接近崩溃~!
后来发现问题出在我用代码创建一个临时目录然后删除临时目录的删除操作上。
说白了session丢失实质就是:应用程序重起!应用程序什么时候自动重起呢?.................
++++++++++++++++++++++++++++++++++++++++++
这是老外写的为什么应用程序重启
++++++++++++++++++++++++++++++++++++++++++
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.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ASP.NET State Service服务web.config:
<sessionState
mode="StateServer"=======这里
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="60"
/>
至于其他目录、文件,因素就太多了......如果你在ASP.NET 2.0中,最好将数据文件放到 App_Data 文件中,但是注意此文件内的文件
客户端是无法访问的,如这样,http://wwww.com.com/App_Data/some.xml,ASP。NET会屏蔽掉
这么怎么写?