gpt4 book ai didi

App Insights 升级到 2.5 后,Azure 应用服务将无法启动

转载 作者:行者123 更新时间:2023-12-03 23:55:29 25 4
gpt4 key购买 nike

我有一个存储库,它使用应用程序洞察来记录有关在 asp.net 中运行的服务的信息。我们有一些 ASP.NET Core 2.0 站点以及一些完整框架的 asp.net 4 应用程序。随着 Application Insights 2.5 的发布,我们在核心站点中获得了对实时流媒体的支持,因此我升级了解决方案中的所有软件包以使用最新的 2.5。然后我构建了分支并通过 VSTS 构建和发布来部署它,我注意到我的直播运行得很好。然后,我发布了之前的版本以及较旧的 2.4 软件包。现在,该环境已损坏,所有核心站点都将不再启动,我收到此错误。

An error occurred while starting the application.

.NET Core 4.6.26020.03 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452 | Microsoft Windows 10.0.14393 | Need help?

在应用程序日志中,我看到

[Critical] Microsoft.AspNetCore.Hosting.Internal.WebHost: Application startup exception
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AI.ServerTelemetryChannel, Version=2.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

[Critical] Microsoft.AspNetCore.Hosting.Internal.WebHost: Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureKeyVault.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureKeyVault.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

这是完整的错误响应:

2018-03-05 18:34:13.783 +00:00 [Critical] Microsoft.AspNetCore.Hosting.Internal.WebHost: Application startup exception
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AI.ServerTelemetryChannel, Version=2.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'Microsoft.AI.ServerTelemetryChannel, Version=2.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup.AddTelemetryChannelAndProcessors(TelemetryConfiguration configuration)
at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptionsSetup.Configure(TelemetryConfiguration configuration)
at Microsoft.Extensions.DependencyInjection.TelemetryConfigurationOptions..ctor(IEnumerable`1 configureOptions)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ApplicationInsightsExtensions.<>c.<AddApplicationInsightsTelemetry>b__13_1(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass22_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass3_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()


2018-03-05 18:34:13.902 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Hosting starting
2018-03-05 18:34:14.273 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4I" started.
2018-03-05 18:34:14.354 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4I" received FIN.
2018-03-05 18:34:14.354 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4I" disconnecting.
2018-03-05 18:34:14.355 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4I" sending FIN.
2018-03-05 18:34:14.519 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4I" stopped.
2018-03-05 18:34:14.521 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Hosting started
2018-03-05 18:34:14.521 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Loaded hosting startup assembly **redacted**
2018-03-05 18:34:14.521 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Loaded hosting startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup
2018-03-05 18:34:14.521 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Loaded hosting startup assembly Microsoft.AspNetCore.AzureKeyVault.HostingStartup
2018-03-05 18:34:14.521 +00:00 [Debug] Microsoft.AspNetCore.Hosting.Internal.WebHost: Loaded hosting startup assembly Microsoft.AspNetCore.Server.IISIntegration
2018-03-05 18:34:14.547 +00:00 [Critical] Microsoft.AspNetCore.Hosting.Internal.WebHost: Hosting startup assembly exception
System.InvalidOperationException: Startup assembly Microsoft.AspNetCore.AzureKeyVault.HostingStartup failed to execute. See the inner exception for more details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.AzureKeyVault.HostingStartup, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks, IntPtr ptrLoadContextBinder)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, IntPtr ptrLoadContextBinder)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
--- End of inner exception stack trace ---
2018-03-05 18:34:14.699 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4J" started.
2018-03-05 18:34:15.295 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request starting HTTP/1.1 GET http://localhost/
2018-03-05 18:34:15.325 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4J" completed keep alive response.
2018-03-05 18:34:15.326 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request finished in 30.3157ms 500 text/html; charset=utf-8
2018-03-05 18:34:15.353 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4J" reset.
2018-03-05 18:34:15.353 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4J" disconnecting.
2018-03-05 18:34:15.358 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4J" sending FIN.
2018-03-05 18:34:15.370 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4K" started.
2018-03-05 18:34:15.372 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4L" started.
2018-03-05 18:34:15.372 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4J" stopped.
2018-03-05 18:34:15.381 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request starting HTTP/1.1 GET http://***.azurewebsites.net/
2018-03-05 18:34:15.382 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4L" completed keep alive response.
2018-03-05 18:34:15.382 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request finished in 1.5282ms 500 text/html; charset=utf-8
2018-03-05 18:34:15.382 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request starting HTTP/1.1 GET http://***.***.com/api/health/all
2018-03-05 18:34:15.383 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4K" completed keep alive response.
2018-03-05 18:34:15.383 +00:00 [Information] Microsoft.AspNetCore.Hosting.Internal.WebHost: Request finished in 0.7699ms 500 text/html; charset=utf-8
2018-03-05 18:34:15.469 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4L" reset.
2018-03-05 18:34:15.469 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4L" disconnecting.
2018-03-05 18:34:15.469 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv: Connection id "0HLC2OUP34I4L" sending FIN.
2018-03-05 18:34:15.470 +00:00 [Debug] Microsoft.AspNetCore.Server.Kestrel: Connection id "0HLC2OUP34I4L" stopped.

最佳答案

尝试执行此操作(请注意,这是使用 .NET CLI,您可以在 powershell 或包管理器中使用等效项)。

dotnet add package Microsoft.AspNetCore.AzureKeyVault.HostingStartup --version 2.1.0-preview1-27946 --source https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json

出于某种原因,azure 正在引用此包,即使您没有使用它。据我发现,它还阻止了许多其他服务的启动,包括 AppInsights。

这将创建一个脏项目,因为它是为核心 2.1 而不是核心 2.0 设计的(其中不存在)。但它应该可以正常工作(至少我的 2 个项目是这样)。

关于App Insights 升级到 2.5 后,Azure 应用服务将无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49120919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com