UrlRewriting.Net Module + IIS7 Equals Page.User == null?

前端 未结 3 1881
萌比男神i
萌比男神i 2021-01-19 05:14

I\'ve used the UrlRewriting.Net module for a couple years now without any problems in Windows XP and Windows 2003. I just recently upgraded my home PC to Windows 7 and start

3条回答
  •  执念已碎
    2021-01-19 05:49

    Microsoft included a fix for this issue (at least for extensionless urls) in Service Pack 1 for Win7 and Windows Server 2008 R2: http://www.microsoft.com/download/en/details.aspx?id=5842

    Also available as a hotfix: http://support.microsoft.com/kb/980368

    After this patch is applied, ASP.NET 4 applications can handle requests for extensionless URLs. Therefore, managed HttpModules that run prior to handler execution will run. In some cases, the HttpModules can return errors for extensionless URLs. For example, an HttpModule that was written to expect only .aspx requests may now return errors when it tries to access the HttpContext.Session property.

    After applying SP1 or the hotfix, no web.config changes are needed to make the session and forms auth work for extensionless URLs rewritten to asp.net pages/handlers/etc.

    I don't know if this fixes anything for rewrites to static file extensions like .htm. My guess is, probably not. I would try to avoid setting runAllManagedModulesForAllRequests="true" in production environments, because it adds unnecessary overhead on static file requests.

提交回复
热议问题