![](/img/trans.png)
[英]503 service unavailable IIS + localhost + WebAPI + VS Android Emulator .Net Core 2
[英].Net core Service Unavailable after Publish to IIS
当我尝试访问它时将我的 up 发布到 IIS 后,我收到错误:服务不可用
http错误503服务不可用。
我接下来该怎么做?
我使用带有 IIS 8.5 的 Windows Server 2008(64 位)。 该应用程序是 web api .NET CORE 2.2.1。
在我安装的 Windows 机器上:
我从视觉工作室发表了一篇文章。 在模块上进入 IIS 我有 AspNetCoreModuleV2。
我拥有的 webconfig 文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\App.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 9d04b7be-318b-4e95-aae3-c47aab07db30-->
CreateWebHostBuilder 方法中的代码:
return WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>().UseSerilog((ctx, cfg) =>
{
cfg.ReadFrom.Configuration(ctx.Configuration)
.MinimumLevel.Verbose()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information);
});
您可以检查以下步骤来检测问题。
dotnet yourapp.dll
,然后按 Enter。) 如果您的应用程序在 IIS 下运行并设置了与 https 的绑定,则需要指定一个带有与其关联的 SSL 证书的 url,当您运行dotnet yourapp.dll
,默认情况下它将在 localhost 上运行,如果您不这样做在 Program.cs 上指定对 UseUrls 的调用。 然后你可以调用你的dotnet yourapp.dll
并且它会工作
var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup() .UseUrls(" http://mywebsite.com ") .Build();
如果应用程序使用 dotnet 命令正确启动,请检查日志文件位置的访问级别(“.\\logs\\stdout”)。 要让应用程序池用户能够读写,请执行以下步骤https://stackoverflow.com/a/7334485/4172872
更新:
应用程序的扩展名真的是“.exe”吗?
<aspNetCore processPath=".\App.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
还有这个https://github.com/dotnet/aspnetcore/issues/10117 - 这是 .NET Core 的一个持续开放的问题
这不是“旧”ASP.NET 的问题,因为它能够将请求“重叠”到两个进程中:(
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.