Is it possible to add Application Insights to a Web Site project type?
In Visual Studio, the following context menu is available for Web Application projects but is missing for Web Site projects.
Just want to share what I ended up with doing. First of all, it seems to work like a charm.
The Application Insight is implemented as an ASP.NET Module, so in order to hook it up for Web Site project you need to do the following:
Microsoft.ApplicationInsights.Web
NuGet packageRegister AI module in web.config
<modules runAllManagedModulesForAllRequests="true">
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules>
Make sure you have ApplicationInsights.config
in Web Site base directory (along with web.config
) - it defines which telemetry you going to be collecting