The SessionStateTempDataProvider requires SessionState to be enabled
Google Solved: I added this attribute to the modules node in the web.config and EVERYTHING magically started working:
<modules runAllManagedModulesForAllRequests="true">
It looks like I'm not alone:
http://forums.asp.net/p/1293974/2509190.aspx
http://www.flyvergrillen.dk/2009/03/26/being-trapped-in-iis/
I think my pure MVC project (that worked in Test environment) was too simple and may not have forced the MVC framework to require TempData and SessionState, so that's how I'll explain it away ;-)
I had the same problem and was of course getting the same error. Even though, I did not need the Session state for my MVC application, I was just interested in getting the application up and running so was willing to enable the session state...why not!!
Even after adding the session state setting to my web.config file,
<system.web>...<sessionState mode="InProc" />...</system.web>
I continued to get the same error message....very confusing!.
I discovered the following explanation which was the definitive resolution to the issue. When running the app pool in integrated mode, you have to ensure that IIS has the session state module mapping defined.
Add the following to <system.webServer> <modules>
:
<add name="SessionStateModule" type="System.Web.SessionState.SessionStateModule" />