我的构建成功构建 + 部署在 Azure 集群中。 VSTS 构建任务
我没有代码更改。我比较了工作和不工作的构建工件。我的 MyCompany.MyService.Api.deps.json 文件中有新条目:
...
"compilationOptions": {
"defines": [
...
"NETFRAMEWORK",
...
],
...
"Microsoft.Bcl.Build": "1.0.21",
"System.IdentityModel": "4.0.0.0",
"System.ServiceModel.Web": "4.0.0.0",
"System.Web.Services": "4.0.0.0",
"System.Runtime.Caching": "4.0.0.0",
"System.ServiceModel.Activation": "4.0.0.0"
},
...
"System.Transactions": "4.0.0.0",
"System.Web": "4.0.0.0",
"System.Diagnostics.Tracing.Reference1": "4.0.20.0",
"System.Runtime.Serialization.Primitives.Reference": "4.0.10.0",
"System.Runtime.Serialization.Xml.Reference": "4.0.10.0"
},
...
"System.Runtime.Reference1": "4.0.20.0",
"System.Threading.Tasks.Reference1": "4.0.10.0",
"System.Resources.ResourceManager.Reference1": "4.0.0.0",
"System.Globalization.Reference1": "4.0.10.0",
"System.Diagnostics.Tools.Reference1": "4.0.0.0",
"System.Diagnostics.Debug.Reference1": "4.0.10.0",
"System.Linq.Reference1": "4.0.0.0",
"System.Collections.Reference1": "4.0.10.0",
"System.Threading.Reference1": "4.0.10.0",
"System.Runtime.Extensions.Reference1": "4.0.10.0",
"System.IO.Reference1": "4.0.10.0",
"System.Runtime.InteropServices.Reference1": "4.0.20.0",
"System.Text.Encoding.Reference1": "4.0.10.0",
"System.Reflection.Primitives.Reference1": "4.0.0.0",
"System.Reflection.Reference1": "4.0.10.0",
"System.Text.Encoding.Extensions.Reference1": "4.0.10.0",
"System.ComponentModel.Reference": "4.0.0.0",
"System.Reflection.Extensions.Reference1": "4.0.0.0"
...
在过去的几个月里,我成功地构建和部署了。然而在过去的 5 天里,从 VSTS 构建构建的代码无法部署到集群。我的 API 服务无法启动,并且出现以下错误。请建议我如何调试。代码在我的本地集群中成功部署和启动。
Unhealthy event: SourceId='System.RA', Property='ReplicaOpenStatus', HealthState='Warning', ConsiderWarningAsError=false.
Replica had multiple failures during open on _ntsfmain_0. API call: IStatelessServiceInstance.Open(); Error = System.Collections.Generic.KeyNotFoundException (-2146232969)
The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.CandidateResolver.ComputeClassification(String dependency)
at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.CandidateResolver.ComputeClassification(String dependency)
at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.CandidateResolver.ComputeClassification(String dependency)
at Microsoft.AspNetCore.Mvc.Internal.DefaultAssemblyPartDiscoveryProvider.CandidateResolver.d__4.MoveNext()
at System.Linq.Enumerable.d__17`2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.GetApplicationPartManager(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcCoreServiceCollectionExtensions.AddMvcCore(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExtensions.AddMvc(IServiceCollection services)
at MyCompany.MyService.Api.Startup.ConfigureDevelopmentServices(IServiceCollection services) in C:\agent_C\_work\19\s\Source\MyCompany.MyService.Api\Startup.cs:line 39
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at MyCompany.MyService.Api.Api.<>c__DisplayClass4_0.b__1(String url, AspNetCoreCommunicationListener listener) in C:\agent_C\_work\19\s\Source\MyCompany.MyService.Api\Api.cs:line 91
at Microsoft.ServiceFabric.Services.Communication.AspNetCore.AspNetCoreCommunicationListener.OpenAsync(CancellationToken cancellationToken)
at Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ServiceFabric.Services.Runtime.StatelessServiceInstanceAdapter.d__13.MoveNext()
For more information see: http://aka.ms/sfhealth