ASP.NET Core 1.0 Web Kestrel 应用程序在 Azure 上的配置
Configuration of ASP.NET Core 1.0 web Kestrel application on Azure
我正在尝试通过 git 在 Azure 上部署 aspnetcore 应用程序。我已经直接按照 https://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html
中所示的方式完成了所有操作
后来我什至按照Problems with deploy ASP.NET 5 (ASP.NET Core) app to Azure and deployed plain project from https://github.com/bigfont/WebNotWar中定义的步骤
在这两种情况下,我得到的只是一条消息
You do not have permission to view this directory or page..
当我尝试访问任何控制器时,响应是
The resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
我很确定部署本身没问题,因为我已经尝试破解代码并且它已做出正确反应。
Azure App Service no longer supports pre-RTM ASP.NET Core
...ASP.NET 5, Core RC1 or RC2 is no longer supported on Azure App Service. The only supported ASP.NET Core stack is RTM on Azure App Service. (emphasis added).
现有的 RC1 应用程序当前继续工作。如果我们在 Azure 放弃支持之前将 ASP.NET 核心 RC1 应用程序部署到 Azure 应用程序服务,那么该应用程序将继续工作,其持续部署也将如此。
ASP.NET Core IIS integration has changed
更改为 web.config
The ASP.NET Core Module 已替换 HttpPlatformHandler。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
// Use the ASP.NET Core Module
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="..\MySite.exe" arguments=""
stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout" />
// Remove the HTTP Platform Handler
// <handlers>
// <add name="httpPlatformHandler" path="*" verb="*"
// modules="httpPlatformHandler" resourceType="Unspecified"/>
// </handlers>
// <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%"
// stdoutLogEnabled="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>
更改为 Startup
public void Configure(IApplicationBuilder app)
{
// Remove call to app.UseIISPlatformHandler();
// Remove call to app.UseForwardedHeaders();
// Both are handled by UseIISIntegration in Main.
}
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseIISIntegration() // Replace UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
host.Run();
}
我正在尝试通过 git 在 Azure 上部署 aspnetcore 应用程序。我已经直接按照 https://docs.asp.net/en/latest/tutorials/your-first-mac-aspnet.html
中所示的方式完成了所有操作后来我什至按照Problems with deploy ASP.NET 5 (ASP.NET Core) app to Azure and deployed plain project from https://github.com/bigfont/WebNotWar中定义的步骤 在这两种情况下,我得到的只是一条消息
You do not have permission to view this directory or page..
当我尝试访问任何控制器时,响应是
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
我很确定部署本身没问题,因为我已经尝试破解代码并且它已做出正确反应。
Azure App Service no longer supports pre-RTM ASP.NET Core
...ASP.NET 5, Core RC1 or RC2 is no longer supported on Azure App Service. The only supported ASP.NET Core stack is RTM on Azure App Service. (emphasis added).
现有的 RC1 应用程序当前继续工作。如果我们在 Azure 放弃支持之前将 ASP.NET 核心 RC1 应用程序部署到 Azure 应用程序服务,那么该应用程序将继续工作,其持续部署也将如此。
ASP.NET Core IIS integration has changed
更改为 web.config
The ASP.NET Core Module 已替换 HttpPlatformHandler。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
// Use the ASP.NET Core Module
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="..\MySite.exe" arguments=""
stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout" />
// Remove the HTTP Platform Handler
// <handlers>
// <add name="httpPlatformHandler" path="*" verb="*"
// modules="httpPlatformHandler" resourceType="Unspecified"/>
// </handlers>
// <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%"
// stdoutLogEnabled="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>
更改为 Startup
public void Configure(IApplicationBuilder app)
{
// Remove call to app.UseIISPlatformHandler();
// Remove call to app.UseForwardedHeaders();
// Both are handled by UseIISIntegration in Main.
}
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseIISIntegration() // Replace UseIISPlatformHandlerUrl()
.UseStartup<Startup>()
.Build();
host.Run();
}