Aspnetcore: 如何在 asp.net core 2.0 中禁用应用程序洞察力?

创建于 2017-06-08  ·  85评论  ·  资料来源: dotnet/aspnetcore

我一直在尝试熟悉 asp.net core 2.0 堆栈。 我创建了一个新项目,并且对于每个请求,我都会在调试窗口中看到应用程序洞察的输出。 由于这只是为了我自己的学习,我不想使用应用程序洞察力,也不希望它弄乱调试窗口。

我发现的大多数建议都是删除 nuget 包,但是 AI 不是通过 nuget 安装的。 安装的唯一 nuget 包是Microsoft.AspNetCoreMicrosoft.NETCore.App ,它们都不依赖于 AI。 此外,我在我的服务或应用程序构建器中找不到任何对 AI 的引用。 因为缺少配置对象和 nuget 包,我希望 AI 根本不在我的项目中,但它仍在记录一些东西。

简而言之,AI 正在登录到调试窗口,尽管它似乎不是我项目的一部分。 我该如何禁用此功能?

最有用的评论

我根本不想要人工智能。

+1

所有85条评论

@比尔希伯特

经过进一步调查,这似乎与 Visual Studio 有关,因为在 VS 之外进行调试(使用 vscode 或仅在命令行上运行)不会显示这些消息。 为了帮助确保每个人都在同一页面上,这是我在一个 HTTP 请求后在 VS 的调试窗口中观察到的输出。

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

我同意,每当我尝试调试 EF 内容(记录大量内容)时,它实际上都会挂起我的 VS。

同样的问题,做一些内存分析以确保我没有泄漏,并注意到很多东西被添加到应用程序洞察ConcurrentDictionary+Node<String, String>

据我所知,我根本没有运行任何见解(没有添加 NuGet 包)

就像 Trcx528 一样,我看到调试控制台的输出如下:
Application Insights Telemetry (unconfigured): {"name":"Microsoft.ApplicationInsights.Dev.Message","time":"2017-07-26T22:02:13.2372631Z","tags":{"ai.operation.id":"95b3c749-......

我们如何禁用它?

同样的问题,做任何事情都需要永远......

ApplicationInsights 正在动态注入。 禁用此功能的一种方法是在项目启动设置中将环境变量 ASPNETCORE_preventHostingStartup 设置为“true”。

请参阅https://github.com/aspnet/Hosting/commit/8377d226f1e6e1a97dabdb6769a845eeccc829ed

@Tratcher你能提供更多细节吗? 从链接的提交中,我无法弄清楚如何修改我的launchSettings.json文件。

有什么理由默认这些是打开的? 您是否在收集使用信息?

Visual Studio 2017 安装了“开发人员分析工具”扩展作为 asp.net 的强依赖项 - 当您尝试卸载时,它也会卸载您的 Web 开发和 dotnet 核心工具 (omg)。 我禁用了这个扩展 - 没有效果,默认情况下会出现 annyoing 调试消息(arg)。

Microsoft.AspNetCore.All 元 nuget 包依赖于应用程序洞察包,因此默认安装 (arg)。 如果您使用特定 RID 发布您的应用程序,应用程序洞察 dll 也会被复制。

@Tratcher正确给出了复杂的、未记录的退出方式:在 VS 中,在您的 Web 项目中打开 Properties > launchSettings.json ,找到您要更改的配置文件,然后更改environmentVariables . 我的项目中的一个示例如下所示:

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

或者,您可以右键单击您的 Web 项目 > 属性 > 调试并在那里添加神秘的环境变量。 嗯。 这应该是选择加入或简单的选择退出!

谢谢! 我发现这只是因为未配置的记录器。

来自 MS 的人可以确认@nzain的解决方法是禁用 Application Insights,还是只是隐藏日志?

我根本不想要人工智能。

我根本不想要人工智能。

+1

我根本不想要人工智能。

+1

@Trcx528请考虑将标题更改为

“如何在 ASP.NET Core 2.0 中删除Application Insights ~preview~

......所以它得到更多的关注? 这个问题仍然存在。 如果它在标题中有“预览”,它可能会被忽略,因为最终版本是最近发布的。

感谢您的帖子,并提醒我们所有人。

我根本不想要人工智能。
+1

我同意,这真是奇怪的行为。

我知道您可以通过 Azure “启用” Application Insights,甚至不必在您的项目中引用它,这很好,但我认为从框架的角度来看,如果这样做的话,成本太高了。

我们将添加一些 ui 以在 VS 中运行时禁用 AI 注入。 我们应该首先添加它(这是一个疏忽)。

@Tratcher建议的解决方法可以正常工作,但会完全禁用点亮功能,因此它影响的不仅仅是洞察力。 例如,ASP.NET Core IIS 模块在启动进程时点亮 IISIntegration 包https://github.com/aspnet/AspNetCoreModule/blob/002c8b9bc9a86cd3b4308e62c1f70ea625cbaae2/src/AspNetCore/Inc/serverprocess.h#L18。

谢谢@davidfowl。 我将暂时保留解决方法,但如果一旦将这个新 UI 添加到 VS 中,发行说明会警告我们使用这个环境变量的人,我们可能应该取消设置它以避免潜在的点亮问题,并使用新的 UI 功能。 再次感谢!

@davidfowl感谢您让我们知道这将很快成为选择加入而不是选择退出! 但是,您提到将有一个 UI - 我不确定我是否理解您的意思,但考虑到我们中的许多人不是从 VS 运行的,因此应该可以在没有 VS / UI 的情况下禁用.

另外,请让我们知道@nzain的解决方法是禁用 Application Insights,还是只是隐藏日志?

@grokky1你到底在说什么? 默认情况下未启用。 Visual Studio 设置一个环境变量来点亮该功能。 系统是这样工作的...

@davidfowl如果默认情况下它没有打开,那么为什么我们中的许多人会在我们的日志中找到它? 这就是我们如何找到这个线程的开始......

但你是对的,我不确定它是如何工作的,我只是想要安慰,除非我选择加入,否则我不会让它运行。

@davidfowl如果默认情况下它没有打开,那么为什么我们中的许多人会在我们的日志中找到它? 这就是我们如何找到这个线程的开始......

什么日志? 在 Visual Studio 或其他地方?

但你是对的,我不确定它是如何工作的,我只是想要安慰,除非我选择加入,否则我不会让它运行。

没问题,这就是我来这里的目的😝。

@davidfowl例如上面由@Trcx528@simonmurdock显示的调试日志(这也是我发现这一点的方式)。 因此,我们想知道在您提到的更改之前, @nzain的解决方法是完全禁用它还是只是隐藏这些日志。

@davidfowl例如上面由@Trcx528和@simonmurdock 显示的调试日志。 因此,我们想知道在您提到的更改之前, @nzain的解决方法是完全禁用它还是只是隐藏这些日志。

就像我之前提到的,Visual Studio 输出。 这不仅仅发生在您运行任何 ASP.NET Core 应用程序时。

@davidfowl Aaah 现在我明白你的意思了。 😄 我也担心这也是运行时的事情。 感谢您的确认。 也期待您提到的 VS 中的选择/退出更改。

@davidfowl - 我正在运行 VS15.4.0(预览版 1)并且默认情况下肯定会收集 App Insights 并将其附加到 ASP.NET Core 应用程序? 它没有被发送到任何地方,但它就在那里。

@davidfowl - 我正在运行 VS15.4.0(预览版 1)并且默认情况下肯定会收集 App Insights 并将其附加到 ASP.NET Core 应用程序? 它没有被发送到任何地方,但它就在那里。

没错,它在Visual Studio中默认亮起,并且没有关闭开关。 您可以关闭所有灯,但这是一个大锤子。 不过,目前这是一种解决方法

以前我们可以在 Program.cs 中选择包含(或不包含)人工智能,为什么我们不能有类似的东西向前发展?

以前我们可以在 Program.cs 中选择包含(或不包含)人工智能,为什么我们不能有类似的东西向前发展?

此功能的目标是启用 AI 以进行外部诊断。 事情已经到位,默认情况下它不会打开,但各种外部操作可能会打开它,而无需触摸应用程序代码(这很脆弱)。

问题是 Visual Studio 体验默认打开它(我相信只有在调试期间)并且没有提供禁用它的选项。

@davidfowl既然您已经解释过了,我就放心了,尤其是当您确认我们很快就能控制它时。

但请设身处地为我们着想。 我们大多数人不知道什么是人工智能,不需要它,也永远不会使用它(我承认我也没有完全理解它!)。 但我们知道它与“遥测”有关,这是一个有毒的词,Azure 团队聪明地选择了“洞察力”这个词。

我的老板不在乎它是否可以被禁用/启用,或者它是否默认关闭并且VS当前有意/无意(或由于错误/疏忽)将其打开。 他所关心的是我们的 IP 有潜在的泄漏,最终谁知道在哪里......谁可以责怪他。 我们有大戏。

在添加该环境变量以禁用 CLI 遥测之前,这与 EF Core 存在相同的问题。

问题是文档总是在代码后面。 因此,只要有遥测,文档就应该向我们解释 - 请记住,我们不像您那样理解框架。 所以当 VS 团队发现这个问题时,他们应该清楚并记录下来。 我知道文档不是你的领域(你的领域是“产生真棒”:smile:),但请给文档团队施加压力。 如果我知道这个功能是什么并且可以向我的团队和我的经理解释它,那么“戏剧性”就会减少。 事后发现它会让任何人跳出邪恶的结论,我希望你能看到...这种事情是个大问题。

(所以我们很清楚,您的 ASP 团队所做的事情是 101% 很棒......感谢您一直花时间提供帮助。)

我打算写一些类似的东西......戴上我的敏捷产品负责人帽子,如果需要,这个功能不应该在那里并且按照用户需要它的方式工作而不是 MSFT 认为它应该做的事情吗?

我一直觉得这是 MSFT 尚未掌握的敏捷/精益,在 Sprint 中工作并定期发布大量新产品和功能很棒,但谁在要求它们,反馈循环在哪里?

@grokky1你到底在说什么? 默认情况下未启用。 Visual Studio 设置一个环境变量来点亮该功能。 系统是这样工作的...

当您引用 AspNetCore.All nuget 包时,它包含应用程序见解。 当你运行 VS 时,它默认是打开的,这很糟糕(我的意见)。 如果我想要 AI(从开发人员/产品所有者的角度),我会选择加入(例如通过 nuget 包)。 这很可能是一个复杂的诡计,只发布了 dll,但默认情况下什么都不做,直到 azure 做一些事情来启用它。 不是这样,我会使用遥测,但我认为您的观点是“不要更改代码以启用/禁用遥测”。 我不同意,但我明白了。

你知道有些人没有 IIS 吗? 什么都没有灯? 没有天蓝色? 没有微软遥测? 没有 IIS? 我知道,这非常难以想象,但我说的是 Linux、nginx、红隼和我自己的受控遥测。 除了人工智能之外,它的工作就像一个魅力让我烦恼。

这与遥测完全不同,但感谢您的反馈。 我们都按照我描述的方式解决了具体问题

我想在这里发表一些声明,希望能澄清和缓解一些人的恐惧。

  1. 在 Visual Studio 中进行调试时,Application Insights 用作一种机制来为你提供有关调试会话的更多信息。 例如,它将上次调试会话中发生的异常添加到代码镜头。 像这样: https ://twitter.com/condrong/status/897227862733869057

    • 无论如何,它不会将数据发送到任何地方。 除非您决定不遗余力地配置本地计算机以将数据发送到某些远程应用程序洞察力。 但即便如此,出于您自己的原因,它仍将是您自己的 App Insights 实例。
  2. 使用 Azure 应用服务时,有一种机制可以选择将 Application Insights 添加到应用程序。 执行此操作时,您将创建自己的 Application Insights 资源,我们可以自动配置应用程序,以便日志等自动转到那里,而无需您重新部署应用程序。 这样一来,人们就可以在 Azure 中遇到问题,并在他们认为 Application Insights 可以获得他们想要的数据时打开它。 例如,App Insights 可以非常轻松地查看对网站的失败请求,并帮助您诊断失败的原因。 我们有许多使用 Application Insights 诊断生产问题的案例研究。 正在解决的问题是必须更改代码并重新部署。 作为微软,我们不是我个人,而是花费大量时间帮助人们成功地将他们的应用程序部署到 Azure。 我们现在必须诊断和解决生产问题的最佳方法之一是将我们可以获取的所有数据放入 Application Insights 中,在那里可以对其进行检查、剖析、监控等。这个功能就是为了让这一切变得轻松和无缝。 问题是人们通常不知道他们需要这个,直到他们这样做,然后要求他们重新部署以打开它是痛苦和烦人的。

  3. 内部 VS 体验碰巧使用了与 App Service 事物使用相同的点亮技术,但它们是非常不同的用例。

这是否有助于解决这方面的一些困惑?

这是否有助于解决这方面的一些困惑?

谢谢(你的)信息。 个人编码镜头是我不喜欢和禁用的另一个功能。 Intellitrace 是另一个。 2017 年显示视觉性能和时间的新功能是我禁用的另一个功能。 简而言之,默认情况下有很多垃圾运行使 VS 陷入困境,而 VS 不需要任何帮助来降低速度。 这与其说是抱怨,不如说是反馈,根据我的经验,我没有发现很多 VS 功能有用。 但我相信你们已经知道了,因为你们收集了这些信息。 我可能是少数,因为我花时间寻找那些东西并禁用它。 但是想想成千上万不知道他们能做到这一点的人。 见鬼,F5 太慢了——没有使用足够的 Ctrl-F5(对于那些不知道的人,Ctrl-F5无需调试即可启动应用程序,而且速度要快得多)。 我知道我听起来很疯狂,你可能会翻白眼,但那些浪费的周期加起来。

简而言之,我个人的反馈是垃圾不等于好。

特别是对于应用程序洞察,问题可能在于它被认为是一种特定于 azure 的产品。 ASP.NET 被定位为“开放”的框架,因此将 azure 产品偷偷带入框架会让人感觉很脏,并导致对 Microsoft 的不信任。 我不在乎它是否几乎是一个 nop,我宁愿在那里没有多余的(尤其是不需要的产品化的)代码。

对于那些想要它的人来说,太棒了。 对于使用它的客户来说,他们喜欢它。 制作(或购买?)一个伟大而有用的功能真是太棒了。 请让它选择加入。

...问题是它被认为是一种特定于天蓝色的产品。 ASP.NET 被定位为“开放”框架,因此_SNEAKING_ azure 产品进入框架感觉很脏,导致对微软的不信任。 我不在乎它是否几乎是一个nop...

+1

我发布了我的项目,即使我在环境变量中包含 ASPNETCORE_preventHostingStartup ,它仍然将 Microsoft.ApplicationInsights 列为依赖项......所以似乎解决方法仅适用于调试但不适用于发布,对吗? 还是我错过了什么?

依赖始终存在,但除非有人点亮它,否则它什么也不做。

问题是我只在服务器上安装了运行时,因此收到了assembly specified in the dependencies manifest was not found消息。 现在,我安装了 SDK,问题就消失了,但这不是一个干净的解决方案。

我不确定这两件事是如何联系起来的。 您能否提供带有重现步骤和完整错误消息的端到端示例。

只需使用空模板创建一个新的 ASP.NET Core 2.0 Web 应用程序。 你会得到一个像这样的最小 csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
  </ItemGroup>

</Project>

现在将项目发布到一个目录并查看生成的.deps.json文件。 无论我在启动设置中包含什么, Microsoft.ApplicationInsights都会包含在其中。

是的,它有效。 就像我之前说的,依赖关系总是被包含在内的,它什么都不做,直到有东西点亮它。

不正确。 不起作用,当运行时没有dll(运行时
店铺)。 举一个例子,linux-arm RID 就是这种情况。 和其他人一样
已经说过,它失败并出现 dll not found 错误。

2017 年 9 月 10 日上午 10:38 schrieb“大卫福勒”通知@github.com:

是的,它有效。 就像我之前说的,总是包含依赖项,
它什么都不做,直到有东西点亮它。


你收到这个是因为你被提到了。
直接回复此邮件,在 GitHub 上查看
https://github.com/aspnet/Home/issues/2051#issuecomment-328328232或静音
线程
https://github.com/notifications/unsubscribe-auth/ANUK-3BK2phWmuA45xY__m7nq1cbya0Tks5sg6AQgaJpZM4N0O32
.

我在 Ubuntu 16.04 上尝试过它,它显示了一条错误消息,表明商店中缺少 DLL。 所以它肯定是行不通的。 我无法复制该消息,因为我现在已经安装了 SDK,但它应该很容易重现。

如果您可以提供特定的重现步骤甚至是带有重现步骤的项目,那就太好了! 不要忘记指定所有环境详细信息(dotnet --info 非常适用)。

期望是默认情况下一切正常(这是我们已经验证的)。 如果我们错过了什么,很高兴知道。 这是我第一次看到关于“默认”体验不起作用的投诉。 我什至无法自己复制它,但我确信我错过了一些被遗漏的具体细节。

@davidfowl在这里精确复制: https ://github.com/dotnet/core-setup/issues/3122
无需项目,默认 Web 模板将应用程序洞察作为依赖项提取。 但是你需要一个手臂设备来进行精确的复制。

Raspian 存储库(Raspberry Pi 默认 Linux 发行版)可能有不同的故事(如果您通过apt-get安装),但我认为他们有同样的问题。 也许其他人可以证实这一点——我们没有树莓派,而且我们的 buildroot 发行版不是 debian。

@Falco20019报告说它在 Ubuntu 16.04 上也失败了 - 在 x64 或 arm 架构上? 你说,当你安装 SDK 时它就起作用了。 也许您可以提供更多详细信息:您之前安装了什么(链接)? 如果它在 linux-x64 上也失败了,那么对于没有 arm 设备的人来说,这更容易重现。

我会等待更多的澄清,因为我很困惑。

arm 问题是因为我们没有 linux arm 的运行时存储(解决方法也发布在问题中)。

@Falco20019这是您遇到的问题吗?

我同意 arm 是利基市场,但你不应该说它“默认工作”。 默认情况下它可以在 windows-x64 上运行。 我认为“在任何地方运行 dotnet”的想法很棒,这就是 java 的成功故事。 就个人而言,我喜欢 dotnet,棘手的嵌入式项目变成了“dotnet 核心机会”。 默认模板应该在任何地方运行,对吧?

是的,但这特别是因为我们没有将 ARM 定位为一流的场景。 ARM 目前处于“如果您进行更改就可以工作”类别。 它不会永远这样,但声称对问题原因的应用程序洞察力是不正确的。

我知道这个帖子是关于让应用洞察选择加入而不是退出,我们需要重新评估体验,但我没有看到任何实际证据证明它是任何提到的问题。 我完全是为了帮忙,我只是不喜欢 FUD 的传播。

davidfowl ...这个线程是关于让应用洞察选择加入而不是退出

同意,我们需要专注于这一点,否则我们会陷入太多问题而无法解决任何问题。

(...伙计们,也许我们可以在新问题中讨论其他问题?)

@davidfowl对不起,生病了,现在才看到。 服务器是“Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-71-generic x86_64)”所以不是 ARM。

我们注意到,当使用 dotnet 运行时包运行 dotnet 发布的已发布结果时,我们会遇到应用洞察问题。 如果我们使用 dotnet sdk 包运行 dotnet publish 的发布结果,它运行正常吗? 这一直是我们的 docker 容器内部的一个问题,因为我们试图仅针对已部署容器的运行时。 这对于 aspnetcore 1 是可行的。

@AlphaCluster你能提供一组明确的重现步骤吗? 您不是使用 ASP.NET 容器基础映像而是使用 dotnet 基础映像吗? 该基本映像没有运行时存储,但您应该收到一个错误解释,而不是应用洞察加载失败。

我们正在使用 dotnet 运行时和正在发布的 sdk tarball 构建我们自己的映像。 我们使用 dotnet publish 发布到一个文件夹,然后我们在运行运行时的容器中运行该文件夹。 这对我们来说在 1.0 版本中工作得很好,但是在 2.0 发布之后,当我们迁移时,如果我们使用运行时容器,就会出现这个问题。

Error:
  An assembly specified in the application dependencies manifest (<project name>.deps.json) was not found:
    package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
    path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
  This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
    aspnetcore-store-2.0.0-linux-x64.xml;aspnetcore-store-2.0.0-osx-x64.xml;aspnetcore-store-2.0.0-win7-x64.xml;aspnetcore-store-2.0.0-win7-x86.xml

这个问题看起来与我们看到的相似,所以如果这是一个不同的问题,我可以打开一个不同的问题。

@AlphaCluster您能否针对用于制作自定义 docker 容器的特定重现步骤提出新问题? 这将帮助我们毫不含糊地重现问题。

在 2.0.0 中,我们添加了运行时存储,它是运行任何具有修剪的发布输出(这是默认行为)的应用程序所必需的。 不幸的是,sdk 和运行时压缩包不包含运行时存储,因此您需要将其安装在 docker 容器中。 有一个示例图像说明了如何在https://github.com/aspnet/aspnet-docker/blob/master/2.0/jessie/runtime/Dockerfile#L5 安装新的运行时存储。

@AlphaCluster :我们决定不使用Microsoft.AspNetCore.All NuGet 包,因为它将 ApplicationInsights dll 带入了我们的发布文件夹,而是我们明确指定了 NuGet 包。

我通过在 Startup 类的 Configure 方法中使用它删除了大量的 Application Insights 遥测日志记录:

var configuration = app.ApplicationServices.GetService<TelemetryConfiguration>();
configuration.DisableTelemetry = true;            

谢谢 Ysris - 这对我有用。 太糟糕了,你必须弄清楚这篇文章的结尾才能找到它。

@tpplyler不客气。
请注意,在 vscode 下,这个补丁会抛出一个应该尝试捕获的异常。

@ysris的解决方案也对我有用。

因此,在Startup.Configure()中设置TelemetryConfiguration.DisableTelemetry = true似乎是“逆转”Visual Studio 默认情况下“点亮”AI 的最简单方法。 AI 程序集仍将作为 NuGet 依赖项包含在内,尤其是在使用Microsoft.AspNetCore.All包的情况下,但它们不会做任何事情。 他们做任何事情的唯一方法是通过其他方式再次点亮,例如在 Azure 中。 将ASPNETCORE_preventHostStartup设置为 true 可以达到相同的效果,正如@Tratcher在 7 月份首次建议的那样,但根据文档,它也

防止自动加载托管启动程序集,包括应用程序的程序集。

正如@davidfowl在 9 月承认的那样,这是一个相当“大锤”,并且可能有不良副作用,所以我坚持使用@ysris的解决方案。

对我来说不幸的是, @ysris的解决方案不起作用。 我不得不使用@Tratcher 提供的“大锤”解决方案。 请参阅https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/724

这非常令人不安,因为 VS 在调试过程中对 AI 的野蛮注入会产生副作用并妨碍调试体验的情况。 我必须同意@brockallen的观点,即我宁愿拥有一个稳定且健全的 VS,而没有我不使用的所有这些绒毛(这让我现在花了将近两天的工作时间)。

大拇指向下隐式选择加入。

我正在关闭这个问题,因为它现在已经达到了这样的程度:有几个不同的错误都在同一时间被讨论,并且没有一个是最好的报告。

总结一下我们所说的一些我不确定是否足够清楚的事情:

  • 当您遇到运行时存储问题时,App Insights 恰好是列出的第一个程序集,这意味着它出现在许多实际上与应用程序洞察力无关的错误消息中。 如果我们不依赖应用洞察力,它会同时出现一些其他 ASP.NET Core 程序集。
  • 如果运行时存储有问题,您可能会得到的副作用之一是程序集可能会出现在您的 bin 中,例如应用程序洞察力。 如果您只依赖 AspNetCore.All 元包,则默认体验是只有您的应用程序集应该在 bin 中。 如果不是这种情况,您将遇到完全独立于 App Insights 的错误。
  • 我们正在添加更明显的选项,以便在 VS 中进行调试时不开启应用洞察。 它们将出现在未来的更新中。 还有更细粒度的控制来排除特定的托管启动程序集,而无需关闭托管启动。

有关 App Insights 未按预期工作的错误应该放在应用程序洞察存储库中,有关运行时存储问题的错误可以在元包存储库中提交,或者只是主页存储库中的另一个问题,其中包含明确的重现步骤,我们可以为您提供帮助找出问题所在。

就像一个循环引用,两个项目相互引用以证明关闭状态是合理的?
参照。 https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/523期望这个项目能够解决这个问题。
我们可以重新打开这个吗? 还是其他?

@DenisDollfus我认为该线程提供了足够的解释/解决方法以被视为已关闭

@Rabadash8820修复会比变通方法更好。 但实际上我错过了@glennc上面的最后一点,即“我们正在添加更明显的选项,以便在 VS 中调试时不打开应用程序洞察。它们将出现在未来的更新中。”,这很棒。
有一个未解决的问题来跟踪此更新的可用性会很有帮助。

我们不在这里跟踪工具问题。

这非常令人沮丧。 在 DotNet Core 2.0 中,ApplicationInsights 被强加给我们,这正是开源的对立面。

@genifycom - 顺便说一句,这已在 Visual Studio 的最新预览版中得到修复。 现在有一个工具选项可以将其关闭。

image

@BillHiebert看起来很完美,谢谢分享。
我在 VS 2017 15.5.5 中看不到它。 它是预览版 15.6 的一部分吗?

编辑:哦,是的,你写了“预览”。 无论如何不要删除我的错误,因为它为任何寻找修复程序的人提供了版本号。

@DenisDollfus - 正确。 更改在 15.6 的预览版中

这已在最新版本的 Visual Studio 15.6.3 中发布。

即使选中了选项并进行了设置:“ASPNETCORE_preventHostingStartup”:“True”
调试时我仍然看到一些遥测日志

image

有任何想法吗?? 我希望完全删除这些日志。

升级到 ASP.NET Core 2.1 😄

如何从现有项目中删除依赖项?
我从 web api .net core 创建了一个模板项目,如果我尝试在与构建不同的计算机上运行,​​我会收到此错误:
image

@afucher假设您的目标是 netcoreapp2.0,看起来您还没有安装 2.0 aspnetcore 运行时商店。 运行时存储包含在 sdk 中: https ://www.microsoft.com/net/download/dotnet-core/sdk-2.1.200 或者您可以在https://www 单独下载 ASP.NET Core 运行时。 microsoft.com/net/download/dotnet-core/runtime-2.0.8。

@davidfowl升级并没有为我解决这个问题。

  1. 本地 App Insights 在 VS (15.7.3) 中被禁用
  2. 运行 ASP.NET Core 2.1

我的输出仍然充斥着 AI 日志。

在“工具”->“选项”中选中“禁用本地 Application Insights ...”对我有用。 对比 15.7.5。

我在 15.8.4; “工具 > 选项 > 项目和解决方案 > Web 项目 > 禁用本地 Application Insights...”已选中; launchSettings.json 有“ASPNETCORE_preventHostingStartup”:“真”。 我仍然在输出中看到 Application Insights...

@RodBarnes在这里也一样

我通过以下方式拔掉了插头:

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

在 Program.cs 中

好的,所以我终于在 ASP.NET Core 2.1 上将调试流静音了;

if (_env.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
    TelemetryConfiguration.Active.DisableTelemetry = true;
    TelemetryDebugWriter.IsTracingDisabled = true;
}

请注意,IsTracingDisabled 是关键,但我在 DisableTelemetry 中留下了很好的衡量标准,而且它在同一解决方案中搜索 .NET Framework 和 .NET Core 项目之间的引用时很有帮助。

感谢 f2calv,您的代码在 ASP.NET Core 2.2 上运行。

“禁用 Asp.Net Core Web 项目的本地 Application Insights”似乎对 VS 15.9.5 中的 AI 没有任何影响,设置TelemetryConfiguration.Active.DisableTelemetry也没有设置环境变量ASPNETCORE_preventHostingStartup (并重新启动VS)。 我仍然可以在输出中看到日志。

“禁用 Asp.Net Core Web 项目的本地 Application Insights”似乎对 VS 15.9.5 中的 AI 没有任何影响,设置TelemetryConfiguration.Active.DisableTelemetry也没有设置环境变量ASPNETCORE_preventHostingStartup (并重新启动VS)。 我仍然可以在输出中看到日志。

同样的问题,为 Asp.Net Core Web 项目禁用本地 Application Insights 对 VS 15.9.4 和 .NET Core SDK 版本 2.1.502 没有任何作用

@ghosttie引用的线程底部是我的关键,这里的官方文档: https ://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#disable -遥测-动态

此页面是否有帮助?
0 / 5 - 0 等级