gpt4 book ai didi

c# - 在 Service Fabric 中调试 .NET Core RC2 Web 应用程序时出现错误消息

转载 作者:行者123 更新时间:2023-11-30 17:37:48 26 4
gpt4 key购买 nike

我终于设法将 .NET Core RC2 Web 应用程序上传到 Service Fabric。但是一旦部署,我就会在 Visual Studio 中收到以下错误消息:

Error message

在 Service Fabric Explorer 中,我在 Web 应用程序的分区中收到以下错误:

Error message Service Fabric

我的 ServiceManifest.xml 如下所示:

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="WebApplicationPkg"
Version="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="WebApplicationType" />
</ServiceTypes>

<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>WebApplication.exe</Program>
</ExeHost>
</EntryPoint>
</CodePackage>
<ConfigPackage Name="Config" Version="1.0.0" />

<Resources>
<Endpoints>
<Endpoint Name="ServiceEndpoint" />
</Endpoints>
</Resources>
</ServiceManifest>

还有我的 project.json:

{
"dependencies": {
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-final",
"NETStandard.Library": "1.5.0-rc2-24027"
},

"tools": {
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net45+win8+dnxcore50"
}
},

"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},

"runtimes": {
"win10-x64": { }
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
"gcServer": true
},

"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},

"scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
}
}

我的 Progam.cs:

public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseStartup<Startup>()
.Build();

host.Run();
}
}

谁能看出我做错了什么?这个错误来自哪里?当我在本地运行应用程序时,一切正常。将其部署到 Service Fabric 后,我立即收到这些错误。

谢谢!

最佳答案

我之前遇到过类似的问题。我还没有找出具体问题。我怀疑这是因为该服务未将自身注册到服务结构运行时,导致健康分区的数量(对于特定服务)低于指定值(应用程序 list 中的 InstanceCount)。

我是根据SDK中提供的OwinCommunicationListener创建通信监听器解决的。我的实现与您在 Hosting repo by weidazhao (David) 中找到的非常相似.我推荐它,因为它似乎与官方 SDK 中的内容非常接近。

关于c# - 在 Service Fabric 中调试 .NET Core RC2 Web 应用程序时出现错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37413596/

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