简体   繁体   English

ASP.NET Core服务已停止

[英]ASP.NET Core served stopped

I have problem with my asp.net Core app. 我的asp.net Core应用有问题。 Application after few minutes stoped. 几分钟后停止应用。 And my jobs in quartz are lost. 我的石英工作丢了。 I read someware the .net core app never stoped so why I have problem with it? 我读过某个软件,.net核心应用程序从未停止过,为什么我对此有问题? My Program.cs include code to use Kestrel: 我的Program.cs包含使用Kestrel的代码:

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

    host.Run();
}

I publish app with standard deployment in visual studio. 我在Visual Studio中发布了具有标准部署的应用程序。

IIS/Azure App Service (runs IIS in behind too) recycle your application pool after some time of idle and/or when the server runs low on resources. IIS / Azure App Service(也在后面运行IIS)在一段时间闲置之后和/或服务器资源不足时,将回收应用程序池。 The statement of not recycling only applies to Kestrel, usually on Linux behind nginx, as its not recommended to use Kestrel as IFS (Internet Facing Server). “不回收”的声明仅适用于Kestrel,通常在nginx之后的Linux上使用,因为不建议将Kestrel用作IFS(Internet Facing Server)。

While you can set the idle time up and a warmup phase, there is no guarantee it won't stop due to low resources. 虽然您可以设置空闲时间和预热阶段,但不能保证它不会因资源不足而停止。

Never run Background Tasks inside ASP.NET/Webapplication. 切勿在ASP.NET/Web应用程序内运行后台任务。 Always use a console application or windows service for reoccurring tasks. 始终将控制台应用程序或Windows服务用于重复执行的任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM