I do not want to steal any credit from another answer, but I wanted to dwell on my comment in detail. I reinstalled Visual Studio (with the long shots I know) and still had the problem. It seems that when the HTTP modules for AI are loaded into IIS Express, things go south quickly, so I only had to download these modules when launching the release configuration.
This means that you update your web.config to remove the AI โโinstructions, and instead move them to Web.Release.config as a conversion so that they load when building the release configuration:
fooobar.com/questions/997597 / ...
Note, however, that the assemblies have changed since the response was sent. Here is what I need to add:
<system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> <httpModules> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" xdt:Transform="Insert"/> </httpModules> </system.web> <system.webServer> <modules> <remove name="ApplicationInsightsWebTracking" xdt:Transform="Insert"/> <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" xdt:Transform="Insert" /> </modules> </system.webServer>
source share