开发者

Visual Studio ASP.NET MVC Save Solution Session End?

Every now and then when I am running/debugging an ASP.NET MVC website through Visual Studio and if I am changing some CSS or HTML in a View while the project is still running, the Session will drop intermittently.

I have confirmed this in the Global.asax adding a Session_End method and setting a break point inside it. As soon as I click Save All through Visual Studio after about 10 or so minutes Session_End is called. I don't even have to refresh the actual page which I think is a little bizarre...

I realize that recompiling the app would cause the session to be lost, but I would not think modifying a View while the application is running would cause this.

A开发者_JS百科ny thoughts on why this could possibly be happening?


Since you are clicking Save All, is it possible that you've also modified a code file or the web.config as well. Any sort of change -- even if you removed it -- would make the file dirty and cause it to be saved as well. This may cause the behavior you are talking about.

You might want to think about using SQL for session state in your development environment. I recently switched to this (because I needed to for our production environment) and no longer see that sort of behavior even when I stop debugging and recompile the application. As long as the session cookie is still valid, it is able to pull my session information from the database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜