I installed vs 2022 today and when running my project I suddenly se all these requests firing in my web front-end
https://dc.services.visualstudio.com/v2/track
You can follow my steps to disable Application Insights when you debug.
First you can add
#if !DEBUG
services.AddApplicationInsightsTelemetry();
#endif
in ConfigureServices
.
And second you need add
#if DEBUG
TelemetryConfiguration.Active.DisableTelemetry = true;
TelemetryDebugWriter.IsTracingDisabled = true;
#endif
in Configure
.
I have a .net 6.0 project for which i want to disable telemetry completely. i have tried the following, but it has no effect. any pointers?
services.AddApplicationInsightsTelemetry(ai => new TelemetryConfiguration
{
DisableTelemetry = true,
});
Thanks for reporting this. We've investigated it and identified the source of that request. The request has been removed and the fix will be included in an upcoming release. You can keep track of when it is released by following this feedback ticket , to which other similar tickets were duped.
I found several solutions (the 1st option helped me):
Tools > Options > Project & Solutions > ASP.NET Core
CSS Hot Reload - Disabled
May you need to restart VS after changing that option.
Go to the browser link toolbar and click the arrow pointing down - shown below. Turn off "Enable browser link" so that it no longer has a check mark Restart Visual Studio after you have done this.
Tools > Options > Project & Solutions > Web Projects
turn on " Disable local Application Insights for ASP.NET Core web projects "
In file Startup.cs:
public void ConfigureServices(IServiceCollection services){
...
#if !DEBUG
services.AddApplicationInsightsTelemetry();
#endif
...
}
and:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env){
...
#if DEBUG
TelemetryConfiguration.Active.DisableTelemetry = true;
TelemetryDebugWriter.IsTracingDisabled = true;
#endif
...
}
Add in file hosts:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.