New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable application insights in asp.net core 2.0? #2051

Closed
Trcx528 opened this Issue Jun 8, 2017 · 80 comments

Comments

Projects
None yet
@Trcx528

Trcx528 commented Jun 8, 2017

I've been attempting to familiarize myself with the asp.net core 2.0 stack. I created a new project and with every request I see output from applications insights in the debug window. As this is just for my own learning I have no desire to use application insights and would rather not have it cluttering the debug window.

Most advice I've found says to just remove the nuget package, however AI is not installed via nuget. The only nuget packages installed are Microsoft.AspNetCore and Microsoft.NETCore.App, neither of which depend on AI. Further more I can not find any reference to AI in my services or appbuilder in my startup. Because the lack of configuration objects and the lack of a nuget package I would expect AI to not be in my project at all, yet it is still logging something.

In short, AI is logging to the debug window, even though it appears not to be part of my project. How can I go about disabling this?

@Tratcher

This comment has been minimized.

Member

Tratcher commented Jun 8, 2017

@Trcx528

This comment has been minimized.

Trcx528 commented Jun 13, 2017

After further investigation this appears to be tied to visual studio as debugging outside of VS (using vscode or just running on the command line) does not show these messages. To help make sure everyone is on the same page, here is the output I observe in the debug window in VS after one HTTP request.

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:62731/  
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 DEBUG http://localhost:62731/  0
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.3967075Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request starting HTTP/1.1 GET http://localhost:62731/","severityLevel":"Information","properties":{"Method":"GET","Host":"localhost:62731","CategoryName":"Microsoft.AspNetCore.Hosting.Internal.WebHost","Scheme":"http","Protocol":"HTTP/1.1","Path":"/","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.3967004Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"DEBUG /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df49","ai.operation.parentId":"|WC1843-a3501fd0-ac63df49.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request starting HTTP/1.1 DEBUG http://localhost:62731/  0","severityLevel":"Information","properties":{"ContentLength":"0","Method":"DEBUG","Host":"localhost:62731","CategoryName":"Microsoft.AspNetCore.Hosting.Internal.WebHost","Scheme":"http","Protocol":"HTTP/1.1","Path":"/","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.4617268Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"DEBUG /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df49","ai.operation.parentId":"|WC1843-a3501fd0-ac63df49.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAF9\" completed keep alive response.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAF9","{OriginalFormat}":"Connection id \"{ConnectionId}\" completed keep alive response.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 129.444ms 200 
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.4703409Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"DEBUG /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df49","ai.operation.parentId":"|WC1843-a3501fd0-ac63df49.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request finished in 129.444ms 200","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Hosting.Internal.WebHost","StatusCode":"200","ElapsedMilliseconds":"129.444","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.4763186Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"The request path / does not match a supported file type","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware","{OriginalFormat}":"The request path {Path} does not match a supported file type","Path":"/","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Request","time":"2017-06-13T13:36:48.3336865Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"DEBUG /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df49","ai.internal.nodeName":"WC1843"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"|WC1843-a3501fd0-ac63df49.","name":"DEBUG /","duration":"00:00:00.1564017","success":true,"responseCode":"200","url":"http://localhost:62731/","properties":{"httpMethod":"DEBUG","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.5106855Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"AuthenticationScheme: Cookies was not authenticated.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler","AuthenticationScheme":"Cookies","{OriginalFormat}":"AuthenticationScheme: {AuthenticationScheme} was not authenticated.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.6199493Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET /","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request successfully matched the route with name 'default' and template '{controller=Home}/{action=Index}/{id?}'.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Routing.RouteBase","{OriginalFormat}":"Request successfully matched the route with name '{RouteName}' and template '{RouteTemplate}'.","RouteName":"default","DeveloperMode":"true","AspNetCoreEnvironment":"Development","RouteTemplate":"{controller=Home}/{action=Index}/{id?}"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.7240547Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Executing action Iceberg.Controllers.HomeController.Index (Iceberg)","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker","{OriginalFormat}":"Executing action {ActionName}","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ActionName":"Iceberg.Controllers.HomeController.Index (Iceberg)"}}}}
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker:Information: Executing action method Iceberg.Controllers.HomeController.Index (Iceberg) with arguments ((null)) - ModelState is Valid
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.7732242Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Executing action method Iceberg.Controllers.HomeController.Index (Iceberg) with arguments ((null)) - ModelState is Valid","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker","ValidationState":"Valid","{OriginalFormat}":"Executing action method {ActionName} with arguments ({Arguments}) - ModelState is {ValidationState}","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ActionName":"Iceberg.Controllers.HomeController.Index (Iceberg)"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:48.7771150Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Executed action method Iceberg.Controllers.HomeController.Index (Iceberg), returned result Microsoft.AspNetCore.Mvc.ViewResult.","severityLevel":"Verbose","properties":{"ActionResult":"Microsoft.AspNetCore.Mvc.ViewResult","CategoryName":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker","{OriginalFormat}":"Executed action method {ActionName}, returned result {ActionResult}.","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ActionName":"Iceberg.Controllers.HomeController.Index (Iceberg)"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:49.6276940Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Home\\PublicIndex.cshtml' started.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Home\\PublicIndex.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' started.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:50.8462465Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Home\\PublicIndex.cshtml' completed in 1212.6438ms.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Home\\PublicIndex.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","ElapsedMilliseconds":"1212.6438","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:50.9127370Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\_ViewStart.cshtml' started.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\_ViewStart.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' started.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:50.9679478Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\_ViewStart.cshtml' completed in 52.5297ms.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\_ViewStart.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","ElapsedMilliseconds":"52.5297","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:50.9763616Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"The view '/Views/Home/PublicIndex.cshtml' was found.","severityLevel":"Verbose","properties":{"ViewName":"/Views/Home/PublicIndex.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor","{OriginalFormat}":"The view '{ViewName}' was found.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor:Information: Executing ViewResult, running view at path /Views/Home/PublicIndex.cshtml.
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:50.9830038Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Executing ViewResult, running view at path /Views/Home/PublicIndex.cshtml.","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor","{OriginalFormat}":"Executing ViewResult, running view at path {Path}.","Path":"/Views/Home/PublicIndex.cshtml","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.0334094Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"View lookup cache miss for view '_Layout' in controller 'Home'.","severityLevel":"Verbose","properties":{"ControllerName":"Home","ViewName":"_Layout","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine","{OriginalFormat}":"View lookup cache miss for view '{ViewName}' in controller '{ControllerName}'.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.1260378Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Shared\\_Layout.cshtml' started.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Shared\\_Layout.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' started.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.2825633Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Compilation of the generated code for the Razor file at 'C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Shared\\_Layout.cshtml' completed in 154.0786ms.","severityLevel":"Verbose","properties":{"FilePath":"C:\\Users\\jpiquette\\Source\\Iceberg\\Views\\Shared\\_Layout.cshtml","CategoryName":"Microsoft.AspNetCore.Mvc.Razor.Internal.DefaultRoslynCompilationService","ElapsedMilliseconds":"154.0786","{OriginalFormat}":"Compilation of the generated code for the Razor file at '{FilePath}' completed in {ElapsedMilliseconds}ms.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3027823Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Tag helper component 'Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent' initialized.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper","ComponentName":"Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent","{OriginalFormat}":"Tag helper component '{ComponentName}' initialized.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3074495Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Tag helper component 'Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent' processed.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper","ComponentName":"Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent","{OriginalFormat}":"Tag helper component '{ComponentName}' processed.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3281429Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Tag helper component 'Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent' initialized.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper","ComponentName":"Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent","{OriginalFormat}":"Tag helper component '{ComponentName}' initialized.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3305192Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Tag helper component 'Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent' processed.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper","ComponentName":"Microsoft.AspNetCore.ApplicationInsights.HostingStartup.JavaScriptSnippetTagHelperComponent","{OriginalFormat}":"Tag helper component '{ComponentName}' processed.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker:Information: Executed action Iceberg.Controllers.HomeController.Index (Iceberg) in 2641.6233ms
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3708883Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Executed action Iceberg.Controllers.HomeController.Index (Iceberg) in 2641.6233ms","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker","ElapsedMilliseconds":"2641.6233","{OriginalFormat}":"Executed action {ActionName} in {ElapsedMilliseconds}ms","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ActionName":"Iceberg.Controllers.HomeController.Index (Iceberg)"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3761765Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAFA\" completed keep alive response.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAFA","{OriginalFormat}":"Connection id \"{ConnectionId}\" completed keep alive response.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 3042.2608ms 200 text/html; charset=utf-8
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:36:51.3822633Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.operation.parentId":"|WC1843-a3501fd0-ac63df48.","ai.internal.nodeName":"WC1843"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Request finished in 3042.2608ms 200 text/html; charset=utf-8","severityLevel":"Information","properties":{"CategoryName":"Microsoft.AspNetCore.Hosting.Internal.WebHost","StatusCode":"200","ElapsedMilliseconds":"3042.2608","DeveloperMode":"true","AspNetCoreEnvironment":"Development","ContentType":"text/html; charset=utf-8"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Request","time":"2017-06-13T13:36:48.3336865Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.location.ip":"127.0.0.1","ai.application.ver":"1.0.0.0","ai.operation.name":"GET Home/Index","ai.cloud.roleInstance":"WC1843","ai.operation.id":"WC1843-a3501fd0-ac63df48","ai.internal.nodeName":"WC1843"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"|WC1843-a3501fd0-ac63df48.","name":"GET Home/Index","duration":"00:00:03.0633276","success":true,"responseCode":"200","url":"http://localhost:62731/","properties":{"httpMethod":"GET","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2082350Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAF9\" received FIN.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv","ConnectionId":"0HL5IC4UQLAF9","{OriginalFormat}":"Connection id \"{ConnectionId}\" received FIN.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2082350Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAFA\" received FIN.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv","ConnectionId":"0HL5IC4UQLAFA","{OriginalFormat}":"Connection id \"{ConnectionId}\" received FIN.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2340466Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAFA\" disconnecting.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAFA","{OriginalFormat}":"Connection id \"{ConnectionId}\" disconnecting.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2340466Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAF9\" disconnecting.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAF9","{OriginalFormat}":"Connection id \"{ConnectionId}\" disconnecting.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2599763Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAFA\" stopped.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAFA","{OriginalFormat}":"Connection id \"{ConnectionId}\" stopped.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-06-13T13:38:38.2599763Z","tags":{"ai.internal.sdkVersion":"aspnet5c:2.1.0-beta3","ai.application.ver":"1.0.0.0"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"Connection id \"0HL5IC4UQLAF9\" stopped.","severityLevel":"Verbose","properties":{"CategoryName":"Microsoft.AspNetCore.Server.Kestrel","ConnectionId":"0HL5IC4UQLAF9","{OriginalFormat}":"Connection id \"{ConnectionId}\" stopped.","DeveloperMode":"true","AspNetCoreEnvironment":"Development"}}}}

@stgeorge

This comment has been minimized.

stgeorge commented Jun 16, 2017

I concur, it actually hangs my VS whenever I try to debug EF stuff (which logs a ton of stuff).

@simonmurdock

This comment has been minimized.

simonmurdock commented Jul 26, 2017

Same issue here, Doing some memory profiling to make sure I have no leaks, and noticing a lot of stuff being added to an application insights ConcurrentDictionary+Node<String, String>

As far as I knew, I had no insights running at all (no NuGet package added)

Just like Trcx528 I see output into my debug console along the lines of:
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-07-26T22:02:13.2372631Z","tags":{"ai.operation.id":"95b3c749-......

How do we disable it?

@redowl3

This comment has been minimized.

redowl3 commented Jul 27, 2017

Same issue, doing anything is taking forever...

@Tratcher

This comment has been minimized.

Member

Tratcher commented Jul 27, 2017

ApplicationInsights is being dynamically injected. One way to disable this is to set the environment variable ASPNETCORE_preventHostingStartup to "true" in your project launch settings.

See aspnet/Hosting@8377d22

@nzain

This comment has been minimized.

nzain commented Aug 22, 2017

@Tratcher can you give more details? From the linked commit, I can't figure out how to modify my launchSettings.json file.

@redowl3

This comment has been minimized.

redowl3 commented Aug 22, 2017

Any reason why these are on by default? Are you collecting usage information?

@nzain

This comment has been minimized.

nzain commented Aug 22, 2017

Visual Studio 2017 has the "Developer Analytics Tools" extension installed as a strong dependency of asp.net - when you try to uninstall, it will uninstall your web development and dotnet core tools, too (omg). I disabled this extension - no effect, the annyoing debug messages appear by default (arg).

The Microsoft.AspNetCore.All meta nuget package has a dependency on application insights package, so it is installed by default (arg). If you publish your app using a specific RID, the application insights dlls are copied, too.

The complicated, undocumented way of opt-out is correctly given by @Tratcher: in VS, on your web project open Properties > launchSettings.json, find the profile you want to change, and change the environmentVariables. An example from my project looks like this:

      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_preventHostingStartup": "True"
      },

Alternatively, you can right click your web project > Properties > Debug and add the mystic environment variable there. Grrr. This should be opt-in or simple opt-out!

@grokky1

This comment has been minimized.

grokky1 commented Aug 31, 2017

Thanks! I discovered this only because of the unconfigured logger.

Can someone from MS please confirm if @nzain's workaround disables Application Insights, or just hides the logs?

I don't want AI at all.

@brockallen

This comment has been minimized.

brockallen commented Aug 31, 2017

I don't want AI at all.

+1

1 similar comment
@chrispaynter

This comment has been minimized.

chrispaynter commented Sep 1, 2017

I don't want AI at all.

+1

@grokky1

This comment has been minimized.

grokky1 commented Sep 1, 2017

@Trcx528 Please consider changing the title to

"How to remove Application Insights in ASP.NET Core 2.0 preview"

...so it gets more attention? This problem is still with us. If it has "preview" in the title it might get ignored because the final version was recently released.

And thanks for your post, and for alerting all of us.

@MBODM

This comment has been minimized.

MBODM commented Sep 6, 2017

I don't want AI at all.
+1

@MikaelGRA

This comment has been minimized.

MikaelGRA commented Sep 7, 2017

I concur, this is really odd behaviour.

I know it's nice that you are able to just "enable" Application Insights through Azure without having to even reference it in your project, but I think the cost is too high from a framework perspective, if this is how it is done.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

We're going to add some ui to disable AI injection when running in VS. We should have added it in the first place (it was an oversight).

The workaround that @Tratcher suggested works fine but will disable the light up feature completely so it can affect more than insights. For example, the ASP.NET Core IIS Module lights up the IISIntegration package when it launches the process https://github.com/aspnet/AspNetCoreModule/blob/002c8b9bc9a86cd3b4308e62c1f70ea625cbaae2/src/AspNetCore/Inc/serverprocess.h#L18.

@chrispaynter

This comment has been minimized.

chrispaynter commented Sep 7, 2017

Thanks @davidfowl. I'm going to leave the workaround in place for now, but it would be really great if once this new UI is added into VS, the release notes warns us who are using this environment variable that we should probably unset it to avoid the potential light up issues, and use the new UI feature. Thanks again!

@grokky1

This comment has been minimized.

grokky1 commented Sep 7, 2017

@davidfowl Thanks for letting us know this will soon be opt-in rather than opt-out! However, you mentioned that there will be a UI for this - I'm not sure I udnerstand what you mean, but consider that many of us don't run from VS, so it should be possible to disable without having VS / a UI.

Also, please let us know whether @nzain's workaround disables Application Insights, or just hides the logs?

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

@grokky1 What exactly are you talking about? It's not on by default. Visual studio sets an environment variable to light the feature up. That's how the system works...

@grokky1

This comment has been minimized.

grokky1 commented Sep 7, 2017

@davidfowl If it's not on by default then why did many of us find it in our logs? That's how we found this thread to begin with...

But you're right I'm not sure how it works, I just want comfort I don't have it running unless I opt-in.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

@davidfowl If it's not on by default then why did many of us find it in our logs? That's how we found this thread to begin with...

What logs? In Visual studio or elsewhere?

But you're right I'm not sure how it works, I just want comfort I don't have it running unless I opt-in.

No problem, that's what I'm here for 😝 .

@grokky1

This comment has been minimized.

grokky1 commented Sep 7, 2017

@davidfowl For example the debug log as shown above by @Trcx528 and @simonmurdock (which is also how I discovered this). So we wanted to know whether for now, until the changes you mentioned, @nzain's workaround disables it completely or just hides those logs.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

@davidfowl For example the debug log as shown above by @Trcx528 and @simonmurdock. So we wanted to know whether for now, until the changes you mentioned, @nzain's workaround disabled it completely or just hides those logs.

Visual studio output, like I mentioned before. That doesn't just happen when you run any ASP.NET Core application.

@grokky1

This comment has been minimized.

grokky1 commented Sep 7, 2017

@davidfowl Aaah now I see what you mean. 😄 I was worried it was a runtime thing too. Thanks for the confirmation. Also looking forward to optin/out changes in VS as you mentioned.

@redowl3

This comment has been minimized.

redowl3 commented Sep 7, 2017

Hi @davidfowl - I'm running VS15.4.0 (Preview 1) and App Insights is definitely being collected and attached to a ASP.NET Core app by default? It's not being sent anywhere but it's there.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

Hi @davidfowl - I'm running VS15.4.0 (Preview 1) and App Insights is definitely being collected and attached to a ASP.NET Core app by default? It's not being sent anywhere but it's there.

That's correct, it lights up in Visual Studio by default and there's no off switch. You can turn off all light up but that's a big hammer. Still, it's a workaround for now.

@redowl3

This comment has been minimized.

redowl3 commented Sep 7, 2017

Previously we had the option in Program.cs to include (or not) AI, any reason why we couldn't have something similar going forward?

@davidfowl

This comment has been minimized.

Member

davidfowl commented Sep 7, 2017

Previously we had the option in Program.cs to include (or not) AI, any reason why we couldn't have something similar going forward?

The goal of this feature is to enable lighting up AI for diagnostics externally. Things are in place such that it isn't on by default, but various external actions may turn it on without having to touch application code (which is brittle).

The problem is that the Visual Studio experience turns it on (only during debugging I believe) by default and doesn't give an option to disable it.

@grokky1

This comment has been minimized.

grokky1 commented Sep 7, 2017

@davidfowl Now that you've explained it, I feel at ease, especially as you've confirmed we'll soon be able to control it.

But put yourself in our shoes. Most of us don't know what AI is, don't need it, and won't ever use it (I admit I too don't fully understand it!). But we know it has something to do with "telemetry", which is such a poisonous word that the Azure team smartly chose the word "insights" instead.

My boss doesn't care if it can be disabled/enabled, or whether it's off by default and VS currently intentionally/unintentionally (or due to a bug/oversight) turns it on. All he cared is that we have a potential leak in our IP, which ends up who knows where... And who could blame him. We had major drama.

It's the same problem as with EF Core, before they added that environment variable to disable CLI telemetry.

The problem is that the docs are always behind the code. So whenever there's telemetry, the docs should explain it to us - keep in mind we don't understand the framework like you do. So when the VS team discovered this issue, they should have come clean and documented it. I know docs aren't your field (your field is "producing the awesome" 😄), but please put pressure on the docs team. If I knew what this feature was and could explain it to my team and my manager, there would have been less "drama". Finding out about it afterwards would make anyone jump to evil conclusions, I hope you see that... For your team it's no biggie (and you may think we're being overly dramatic over nothing), but for your users and their managers, this sort of thing is a major biggie.

(So we're clear, the stuff your ASP team does is 101% awesome... And thanks for always taking time to help.)

@redowl3

This comment has been minimized.

redowl3 commented Sep 7, 2017

I was going to write something similar... Putting my Agile Product Owner hat on, shouldn't this feature be there if requested and work how users need it to work not what MSFT thinks it should do?

I've always felt this is the bit of Agile/Lean that MSFT has yet to grasp, working in Sprints and regular releases with tons of new products and features is great but who is asking for them and where is the feedback loop?

@Rabadash8820

This comment has been minimized.

Rabadash8820 commented Oct 25, 2017

@ysris's solution worked for me as well.

So it looks like setting TelemetryConfiguration.DisableTelemetry = true in Startup.Configure() is about the simplest way to "reverse" the "lighting up" of AI that Visual Studio does by default. The AI assemblies will still be included as NuGet dependencies, especially if using the Microsoft.AspNetCore.All package, but they won't do anything. The only way they would do anything is if lit up again by some other means, e.g. in Azure. Setting ASPNETCORE_preventHostStartup to true achieves the same effect, as first suggested by @Tratcher back in July, but according to the docs, it also

Prevents the automatic loading of hosting startup assemblies, including the app's assembly.

This is quite a "big hammer", as @davidfowl conceded in September, and probably has undesired side effects, so I'm sticking with @ysris's solution.

@Pvlerick

This comment has been minimized.

Pvlerick commented Oct 31, 2017

Unfortunately for me, @ysris' solution didn't work. I had to use the "big hammer" solution provided fy @Tratcher. See Microsoft/ApplicationInsights-dotnet-server#724

This is very disturbing, as the brutal injection by VS of AI in the process being debugged creates a situation that has side effects and hampers the debugging experience. I have to agree with @brockallen that I'd rather have a stable and sound VS without all this fluff that I'm not using (and that cost me almost two days of work now).

@craigajohnson

This comment has been minimized.

craigajohnson commented Oct 31, 2017

Big thumbs down to implicit opt-ins.

@glennc

This comment has been minimized.

Member

glennc commented Nov 2, 2017

I am closing this issue as it has now reached the point were there are several different bugs all being talked about at the same time and none of them are best reported here.

To summarize some of the things we said that I am not sure were made clear enough:

  • App Insights happens to be the first assembly listed when you have a problem with the runtime store, which means it appears in many error messages that actually have nothing to do with application insights. If we didn't depend on app insights it would some other ASP.NET Core assembly that was appearing there at the same time.
  • One of the side effects you can get if you have problems with the runtime store is that assemblies can appear in your bin, like application insights. The default experience if all you depend on is the AspNetCore.All metapackage is that only your app assembly should be in the bin. If that isn't the case you are hitting a bug completely independent of App Insights.
  • We are adding more obvious options to not turn on app insights when debugging in VS. They will appear in a future update. There is also more fine-grained control to exclude specific hosting startup assemblies without turning hosting startup off in general.

Bugs about the App Insights not working as expected should go in the app insights repo, bugs about runtime store problems can be filed in the meta-packages repo, or just another issue here in the home repo with clear repro steps and we can help you work out what the problem is.

@glennc glennc closed this Nov 2, 2017

@DenisDollfus

This comment has been minimized.

DenisDollfus commented Nov 13, 2017

There is like a circular reference, both projects references each other to justify a close status?
Cf. Microsoft/ApplicationInsights-aspnetcore#523 which is expecting this project to fix the issue.
Can we re-open this one? Or the other?

@Rabadash8820

This comment has been minimized.

Rabadash8820 commented Nov 13, 2017

@DenisDollfus I think this thread provides enough explanation/work-arounds to be considered closed

@DenisDollfus

This comment has been minimized.

DenisDollfus commented Nov 13, 2017

@Rabadash8820 A fix would be better than workarounds. But actually I missed @glennc last point above stating that "We are adding more obvious options to not turn on app insights when debugging in VS. They will appear in a future update.", which is great.
Having an open issue to track the availability of this update would be helpful.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Nov 13, 2017

We don't track tooling issues on here.

@genifycom

This comment has been minimized.

genifycom commented Jan 26, 2018

This is VERY frustrating. With DotNet Core 2.0, ApplicationInsights is being forced on us which is exactly the OPPOSITE of open source.

@BillHiebert

This comment has been minimized.

BillHiebert commented Feb 6, 2018

@genifycom - btw this is fixed in the latest previews of Visual Studio. There is now a tools option to turn it off.

image

@DenisDollfus

This comment has been minimized.

DenisDollfus commented Feb 12, 2018

@BillHiebert That looks perfect, thanks for sharing.
I don't see it in VS 2017 15.5.5. Is it part of preview 15.6?

EDIT: Oh yes you wrote "preview". Anyway not deleting my mistake as it provides version number for anyone looking for the fix.

@BillHiebert

This comment has been minimized.

BillHiebert commented Feb 13, 2018

@DenisDollfus - correct. The change is in a preview of 15.6

@thewebchameleon

This comment has been minimized.

thewebchameleon commented Mar 21, 2018

this has been released in the latest version of Visual Studio 15.6.3.

@micheleissa

This comment has been minimized.

micheleissa commented Jun 3, 2018

Even with the checked options and setting up: "ASPNETCORE_preventHostingStartup": "True"
I still see some telemetry logs while debugging

image

Any ideas?? I wish to fully remove these logs.

@davidfowl

This comment has been minimized.

Member

davidfowl commented Jun 5, 2018

Upgrade to ASP.NET Core 2.1 😄

@afucher

This comment has been minimized.

afucher commented Jun 9, 2018

How to remove the dependency from an existing project?
I create a template project from web api .net core and if I try to run in a different computer from the build I'm getting this error:
image

@JunTaoLuo

This comment has been minimized.

Contributor

JunTaoLuo commented Jun 11, 2018

@afucher Assuming you are targeting netcoreapp2.0, it looks like you have not installed the 2.0 aspnetcore runtime store. The runtime store is included with the sdk: https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.200 or you can download the ASP.NET Core Runtime individually at https://www.microsoft.com/net/download/dotnet-core/runtime-2.0.8.

@davidsavagejr

This comment has been minimized.

davidsavagejr commented Jul 20, 2018

@davidfowl upgrading didn't fix it for me.

  1. Local App Insights is disabled in VS (15.7.3)
  2. Running ASP.NET Core 2.1

My output is still flooded with AI logs.

@rezazein

This comment has been minimized.

rezazein commented Jul 23, 2018

Checking "Disable local Application Insights ..." in Tools -> Options worked for me. VS 15.7.5.

@RodBarnes

This comment has been minimized.

RodBarnes commented Sep 14, 2018

I'm on 15.8.4; "Tools > Options > Projects & Solutions > Web Projects > Disable local Application Insights..." is checked; launchSettings.json has "ASPNETCORE_preventHostingStartup": "True". I still see Application Insights in the Output...

@btastic

This comment has been minimized.

btastic commented Oct 2, 2018

@RodBarnes same here

I pulled the plug by doing:

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
#if !DEBUG
        .UseApplicationInsights()
#endif
        .UseStartup<Startup>();

in Program.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment