I am running a mixed MVC application inside a subfolder of a web forms application.
Everything worked fine in VS 2010 debugging (Cassini), but when I deployed to IIS7.5
I got the following error:
'HttpContext.SetSessionStateBehavior' can only be invoked before 'HttpApplication.AcquireRequestState' event is raised.
These are errors in the last line ( httpHandler.ProcessRequest(HttpContext.Current); ) in the default.aspx file of the MVC application subdirectory.
public void Page_Load(object sender, System.EventArgs e) { string pathToRewriteTo = Request.Path.ToLowerInvariant().Replace("default.aspx", "Home/Index"); HttpContext.Current.RewritePath(pathToRewriteTo, false); IHttpHandler httpHandler = new MvcHttpHandler(); httpHandler.ProcessRequest(HttpContext.Current); }
However, if I manually navigate to Home / Index from the MVC root folder, I can see my application from there.
I was looking for an error, and I only find answers to server transfers, not MVC routes.
I also already checked the IIS7.5 configuration for the route processing module, application pool running in integrated mode, etc.
Any help would be appreciated.
Tonicia kelly
source share