I have an application that I run in Visual Studio 2013 under IIS Express server. The problem is that session data is not kept between pages and I find with null objects that weren't null the page before. If I compile the application and deploy it on a web server
with IIS it works normally, so it must be something with IIS Express. I searched the config files in the
document folders, but really don't know what it is. The application runs correctly in Visual Studio 2010, which doesn't run IIS Express.
From your description, your application work well on IIS, but it doesn't work on IIS Express. I also created a sample using Visual Studio 2013, and tested it on IIS and IIS Experss. They all worked well. So, as you said, the issue is related to the IIS Express,
I suggest you could try to reinstall the IIS Express.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
I suggest you could create a new project to check it.
Best Regards,
Dillion
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
I'm debugging the code on the same machine witn VS 2013 and VS 2010 and I found where the code behaves differently. After the code behind has been executed and the page has been built, in VS 2010 the execution ends. In VS 2013 after the page has been built
I get another call to the method context_BeginRequest(object sender, EventArgs e), which redirects the application to the
starting page, where the instruction Session.Clear() clears the session. The problem now is: why is there this additional call to context_BeginRequest method? Why does it redirect to the starting page and not to the page it is currently in? Thanks, Luke.
I found what it is. Checking the calling urls to the context_BeginRequest method, I found that one was from "browserLink". So the solution is to disable browser link http://www.asp.net/visual-studio/overview/2013/using-browser-link.
None
0 Points
4 Posts
IIS Express doesn't keep session data
Nov 21, 2014 06:22 AM|Luke791|LINK
document folders, but really don't know what it is. The application runs correctly in Visual Studio 2010, which doesn't run IIS Express.
Thanks,
Luke
All-Star
45489 Points
7008 Posts
Microsoft
Re: IIS Express doesn't keep session data
Nov 24, 2014 05:03 AM|Zhi Lv - MSFT|LINK
Hi Luke,
From your description, your application work well on IIS, but it doesn't work on IIS Express. I also created a sample using Visual Studio 2013, and tested it on IIS and IIS Experss. They all worked well. So, as you said, the issue is related to the IIS Express, I suggest you could try to reinstall the IIS Express.
Please refer to this article.
http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-express-overview
Best Regards,
Dillion
None
0 Points
4 Posts
Re: IIS Express doesn't keep session data
Nov 24, 2014 08:50 AM|Luke791|LINK
Hi, I reinstalled IIS Express to the latest version but the problem persists. Session uses session variables. Thanks
All-Star
45489 Points
7008 Posts
Microsoft
Re: IIS Express doesn't keep session data
Nov 25, 2014 07:16 AM|Zhi Lv - MSFT|LINK
Hi Luke,
I suggest you could create a new project to check it.
Best Regards,
Dillion
None
0 Points
4 Posts
Re: IIS Express doesn't keep session data
Nov 25, 2014 10:32 AM|Luke791|LINK
starting page, where the instruction Session.Clear() clears the session. The problem now is: why is there this additional call to context_BeginRequest method? Why does it redirect to the starting page and not to the page it is currently in? Thanks, Luke.
None
0 Points
4 Posts
Re: IIS Express doesn't keep session data
Nov 28, 2014 04:32 AM|Luke791|LINK
Thanks to stackoverflow.com