I ran into a problem where HttpContext.Current.Profile is returning null. This was after turning anonymous identification on. After investigation, I found the reason for this was Url rewriting. Using HttpContext.RewritePath caused the Profile module to terminate (or failed to start)


The following change in web.config will ensure that all modules will run irrespective of such events.

<system.webServer><modules runAllManagedModulesForAllRequests="true"><add name="UrlRewrite" type="VijayT.UrlRewrite,VijayT" /></modules></system.webServer>

The attribute runAllManagedModulesForAllRequests should be set to true. This also solved the session problem that I encountered earlier. See previous post.