在 Azure 上托管时出现 CGI 错误
CGI errors when hosting on Azure
我有一个网站在我的本地 IISExpress 上运行良好,但是当我将它上传到 Azure 时,它非常缓慢并且经常 returns 出现错误:The specified CGI application encountered an error and the server terminated the process
在 project.json 我有(除其他外)这些依赖项:
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
和这些命令:
"commands": {
"web": "MyApp",
},
我的 hosting.json 文件有:
{
"server": "Microsoft.AspNet.Server.Kestrel"
}
我的 Startup.cs 有:
public class Startup
{
public IConfigurationRoot Configuration { get; set; }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
//etc...
我应该使用 Kestrel 吗?我没有针对任何非 Windows 平台,所以我只对 IISExpress 和 Azure 感兴趣。
我不得不从 free/shared 升级到 B1 实例。显然部署期间的包对于 free/shared 设置来说太大了。
我有一个网站在我的本地 IISExpress 上运行良好,但是当我将它上传到 Azure 时,它非常缓慢并且经常 returns 出现错误:The specified CGI application encountered an error and the server terminated the process
在 project.json 我有(除其他外)这些依赖项:
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
和这些命令:
"commands": {
"web": "MyApp",
},
我的 hosting.json 文件有:
{
"server": "Microsoft.AspNet.Server.Kestrel"
}
我的 Startup.cs 有:
public class Startup
{
public IConfigurationRoot Configuration { get; set; }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
//etc...
我应该使用 Kestrel 吗?我没有针对任何非 Windows 平台,所以我只对 IISExpress 和 Azure 感兴趣。
我不得不从 free/shared 升级到 B1 实例。显然部署期间的包对于 free/shared 设置来说太大了。