26

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

Does anyone know why this would suddenly start happening after upgraing to vs 2022?

enter image description here

I don't want to see these requests in local dev environment. How can I remove them?


I tried checking this box but it didn't help:

enter image description here

I also tried ignoring the AI dependency after right-clicking clicking Project -> Configure Application Insights, but that seems to do nothing:

enter image description here

keuleJ
  • 3,418
  • 4
  • 30
  • 51
Bassie
  • 9,529
  • 8
  • 68
  • 159
  • 2
    https://stackoverflow.com/questions/49148355/what-is-the-use-of-https-dc-services-visualstudio-com-v2-track – DavidG Nov 09 '21 at 17:03
  • 1
    @DavidG Thanks David, any idea how I can disable this? I don't need these requests firing when I'm working locally in VS – Bassie Nov 09 '21 at 17:05
  • 3
    Here's an open ticket on the VS forum about it: https://developercommunity.visualstudio.com/t/Visual-Studio-2022-Application-Insights-/1578628 the MS response is that it's caused by the application insights SDK but there are many replies explaining that it's happening without that SDK in use – Zout Nov 25 '21 at 18:11
  • 1
    Really an annoyance. Tempted to add dc.services.visualstudio.com 127.0.0.1 to system hosts file – zameb Nov 29 '21 at 13:59
  • This issue seems to be caused by the AppInsights SDK and not Visual Studio. Please file a ticket with that product at https://github.com/microsoft/ApplicationInsights-dotnet/issues (https://github.com/microsoft/ApplicationInsights-dotnet/blob/main/BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/Endpoints/Constants.cs#L9) – MD. RAKIB HASAN Dec 02 '21 at 10:12
  • @MD.RAKIBHASAN when trying to raise this issue on the linked github, I was sent back to MS (https://github.com/microsoft/ApplicationInsights-dotnet/issues/2490) – Bassie Dec 03 '21 at 16:43

3 Answers3

5

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.

enter image description here

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
3

I found several solutions (the 1st option helped me):

1. Disable browser connection

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.

enter image description here

2. Disable Insights

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
...
}

3. Edit file hosts

Add in file hosts:

  • 127.0.0.1 dc.services.visualstudio.com
  • 127.0.0.1 rt.services.visualstudio.com
Angry Fox
  • 53
  • 1
  • 7
2

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.

Tim
  • 14,999
  • 1
  • 45
  • 68
  • 1
    Hi Tim, any update on this? I upgraded to the new version today, but still seeing the requests. Also, do you have any thoughts on this, related question? https://stackoverflow.com/questions/70470877/why-does-vs-2022-have-log-all-this-garbage-in-the-console – Bassie Dec 24 '21 at 08:20
  • 1
    Still not available on 14 Jan 2022. Why do I get the feeling that this request was not included in error, and is just part of MS's plan to jam telemetry into everything? – Bassie Jan 14 '22 at 13:56
  • 1
    Hi @Bassie Sorry I missed your earlier message - got lost over the holidays. Sorry to disappoint but there's no conspiracy here. The fix is line for the next release (17.1 Preview 3 - the preview 2 cut off had already happened before the holidays when the fix was committed). The feedback ticket above is properly tracking it and will let you know when it has been released. Shouldn't be much longer. – Tim Jan 15 '22 at 15:46
  • @Bassie It looks like the linked question in your first comment was deleted, but I think I found the replacement so I'll respond there. – Tim Jan 15 '22 at 15:54