We have some code that has been running on IIS 6 for a long time now. We are in the process of moving applications to a new IIS 7.0 server. We have an application that has some code in the Session_Start method of the global.asax that sets some session
variables. As best as we can tell, this code is either not running or the session variables are losing their values. We have tested this application on a Vista PC running IIS 7 for Vista and it seems to be working. Do you have any ideas?
Thanks for the reply. Yes and it is set to the default. It has to be something with that project because like I said, if I create a new project that executes the same code, it works fine.
I think we just found the solution to our problem.
We were moving an application from IIS 6 to IIS 7 and we ran into a problem.The code in the global.asax Session_Start was not running.However, this code had been running fine in every environment (development, testing, production) in IIS 6.Through a lot of research and trial and error, we figured out a solution to the problem.I’m not sure the problem was necessarily with IIS 7 because we saw posts on the Internet of the same symptoms on IIS 6.0.It should be noted that when the code is executed within VS, it ran fine too. Our standard has been to use the Web Deployment Project for creating the compiled output
that is then copied to a IIS server.Our standard has also been to merge all outputs to a single assembly.When this is done, all compiled code is put into a single DLL.If you use the global.asax, there is file called App_global.asax.compiled that is used to tell the runtime engine to reference the single DLL for the global.asax code.It would appear that when you have your project compiled into a single DLL, this problem manifests itself. Our solution was to change the way the code was to be compiled.Rather than merging all outputs to a single assembly, we set it to merge all pages and control outputs to a single assembly.Do so still creates the App_global.asax.compiled file, but instead the compilation of the global.asax code is into its own DLL (App_global.asax.dll).By doing this the code in the global.asax started working.
leefar
0 Points
5 Posts
Problem with session on IIS 7
Apr 20, 2009 01:39 PM|LINK
We have some code that has been running on IIS 6 for a long time now. We are in the process of moving applications to a new IIS 7.0 server. We have an application that has some code in the Session_Start method of the global.asax that sets some session variables. As best as we can tell, this code is either not running or the session variables are losing their values. We have tested this application on a Vista PC running IIS 7 for Vista and it seems to be working. Do you have any ideas?
session variable IIS 7
budugu
All-Star
41188 Points
6034 Posts
Re: Problem with session on IIS 7
Apr 20, 2009 02:12 PM|LINK
Did you checked session timeout value in IIS7 settings?
"Don't be afraid to be wrong; otherwise you'll never be right."
leefar
0 Points
5 Posts
Re: Problem with session on IIS 7
Apr 20, 2009 02:21 PM|LINK
Thanks for the reply. Yes and it is set to the default. It has to be something with that project because like I said, if I create a new project that executes the same code, it works fine.
leefar
0 Points
5 Posts
Re: Problem with session on IIS 7
Apr 20, 2009 04:11 PM|LINK
We were moving an application from IIS 6 to IIS 7 and we ran into a problem. The code in the global.asax Session_Start was not running. However, this code had been running fine in every environment (development, testing, production) in IIS 6. Through a lot of research and trial and error, we figured out a solution to the problem. I’m not sure the problem was necessarily with IIS 7 because we saw posts on the Internet of the same symptoms on IIS 6.0. It should be noted that when the code is executed within VS, it ran fine too. Our standard has been to use the Web Deployment Project for creating the compiled output that is then copied to a IIS server. Our standard has also been to merge all outputs to a single assembly. When this is done, all compiled code is put into a single DLL. If you use the global.asax, there is file called App_global.asax.compiled that is used to tell the runtime engine to reference the single DLL for the global.asax code. It would appear that when you have your project compiled into a single DLL, this problem manifests itself. Our solution was to change the way the code was to be compiled. Rather than merging all outputs to a single assembly, we set it to merge all pages and control outputs to a single assembly. Do so still creates the App_global.asax.compiled file, but instead the compilation of the global.asax code is into its own DLL (App_global.asax.dll). By doing this the code in the global.asax started working.