[英]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.