If you are using the βnewβ asp.net kernel in VS2017, then the old instructions are incorrect, as with previous xproj-based asp.net kernel implementations.
If you are creating a new asp.net web project in VS2017, ApplicationInsights will already be installed from the very beginning and should be versions:
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.2.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
(or newer if the main asp.net team has updated them at all)
These projects will already be connected to Application Insights, not in Startup.cs (this is the old way), but in Program.cs:
new WebHostBuilder() ... .UseApplicationInsights() // this starts up appinsights in asp.net core now ... .UseOtherThings();
and possibly in web templates, for example:
@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
above and
@Html.Raw(JavaScriptSnippet.FullScript)
at the bottom of the <head> .
if you upgrade from a previous version of the asp.net kernel and applications, you will also have to uninstall things like:
@Html.ApplicationInsightsJavaScript(TelemetryConfiguration)
from _Layout.cshtml and replace them with the lines above, and you can delete all lines, for example:
app.UseApplicationInsightsExceptionTelemetry ();
in Startup.cs (if you are using version 2.x packages, I believe that these items will also display obsolete warnings, as they are no longer needed)
VS2017 official release notes include this information as a section in the βknown issuesβ for understanding applications