简体   繁体   English

HTTP 错误 500.30 - ANCM 进程中启动失败 Asp.net-Core 3.1

[英]HTTP Error 500.30 - ANCM In-Process Start Failure Asp.net-Core 3.1

I am writing an API using Asp.net Core 3.1 .我正在使用Asp.net Core 3.1编写API I'm using IHostedService for background processing in the API .我在API中使用IHostedService进行后台处理。

IHostedService class: IHostedService class:

    public class DataUpdateBackgroundService : Microsoft.Extensions.Hosting.BackgroundService
    {
        private ITurkeyProvinceDataService _dataService;

        public DataUpdateBackgroundService(ITurkeyProvinceDataService dataService)
        {
            _dataService = dataService;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            stoppingToken.Register(() =>
                Console.WriteLine(""));

            while (!stoppingToken.IsCancellationRequested)
            {

                // Your code here
                _dataService.UpdateData();
                await Task.Delay(TimeSpan.FromMinutes(10), stoppingToken);
            }

        }
    }

In my UpdateData function,在我的UpdateData function 中,

I record data in a database for 10 minutes.我在数据库中记录数据 10 分钟。 I am pulling this saved data from a different API.我从不同的 API 中提取此保存的数据。

As such, it works smoothly on my local device.因此,它可以在我的本地设备上顺利运行。

When I publish this version in Azure Web Service , I get the error in the title.当我在Azure Web Service中发布此版本时,标题中出现错误。 But if I don't use my UpdateData function, I don't get the error.但如果我不使用我的UpdateData function,我不会收到错误消息。

I could not understand whether it is related to Azure or my function should be in a structure like async.我不明白它是否与 Azure 或我的 function 应该采用类似异步的结构有关。 Can you help me with this?你能帮我解决这个问题吗?

This issue occurs because of mixing library references in the project.出现此问题的原因是项目中混合了库引用。 For example, if you are upgrading your .NET Core 2.2 application to .NET Core 3.1, you should make sure there is no reference or dependency to 2.2 libraries.例如,如果您要将 .NET Core 2.2 应用程序升级到 .NET Core 3.1,则应确保没有对 2.2 库的引用或依赖。

I test in my site and work well.我在我的网站上测试并且运行良好。 Go to your webapp and click Extensions and remove the extension from the App service . Go 到您的 webapp 并单击Extensions从 App service 中删除扩展 And check the nuget package in you local.并检查您当地的 nuget package。 Here are similar issue you could refer to.这是您可以参考的类似问题

Update :更新

The reason for this problem stems from var info = TimeZoneInfo.FindSystemTimeZoneById("Turkey Standard Time");这个问题的原因源于var info = TimeZoneInfo.FindSystemTimeZoneById("Turkey Standard Time"); that i use for date operations in update data function.我用于更新数据 function 中的日期操作。

暂无
暂无

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

相关问题 ASP.NET 核心 3.1 - HTTP 错误 500.30 - ANCM 进程中启动失败 - ASP.NET Core 3.1 - HTTP Error 500.30 - ANCM In-Process Start Failure IIS 和 NET Core HTTP 错误 500.30 - ANCM 进程中启动失败 .net 核心 3.1 - IIS and NET Core HTTP Error 500.30 - ANCM In-Process Start Failure .net core 3.1 ASP.NET 核心 3.0 - InProcess 与 OutOfProcess(HTTP 错误 500.30 - ANCM 进程内启动失败) - ASP.NET Core 3.0 - InProcess vs. OutOfProcess (HTTP Error 500.30 - ANCM In-Process Start Failure) .NET 核心托管到 IIS,我收到 HTTP 错误 500.30 - ANCM 进程内启动失败 - .NET Core hosting to IIS, I get HTTP Error 500.30 - ANCM In-Process Start Failure HTTP 错误 500.30 - ANCM 进程中启动失败 - HTTP Error 500.30 - ANCM In-Process Start Failure .Net Core 3.0 HTTP 错误 500.30 - 尝试在启动 class 中添加 AddHostedService() 时,ANCM 进程内启动失败 - .Net Core 3.0 HTTP Error 500.30 - ANCM In-Process Start Failure When trying to add AddHostedService() in startup class Function 应用程序给出异常 HTTP 错误 500.30 - ANCM 进程内启动失败 - Function app giving exception HTTP Error 500.30 - ANCM In-Process Start Failure 如何诊断 .net core ANCM 进程内启动失败 - How to diagnose .net core ANCM In-Process Start Failure HTTP 错误 500.0 - ASP.NET 核心 IIS Dot.net 核心 3.1 中的托管失败(进程中) - HTTP Error 500.0 - ASP.NET Core IIS hosting failure (in-process) in Dot net core 3.1 .NET 内核 HTTP 错误 500.0 - ANCM 进程内处理程序加载失败 - .NET Core HTTP Error 500.0 - ANCM In-Process Handler Load Failure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM