gpt4 book ai didi

asp.net-core-2.0 - 在 IIS 中托管 asp.core 2.0 web api 时出错

转载 作者:行者123 更新时间:2023-12-05 00:14:06 26 4
gpt4 key购买 nike

我已经开发了 asp.net core 2.0 webapi 并在 IIS 中托管。我安装了 Hosting Bundle Installation 中提到的托管包

但由于某种原因,我收到以下错误:

An error occurred while starting the application.

.NET Core 4.6.25815.02 X64 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452 | Microsoft Windows 6.1.7601 S

标准输出中的一些错误行...
warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Using an in-memory repository. Keys will not be persisted to storage.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[59]
Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warn: Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository[50]
Using an in-memory repository. Keys will not be persisted to storage.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[59]
Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
warnwarn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {973e8bbf-2ca5-4c7f-a2ac-2672c9bb8041} may be persisted to storage in unencrypted form.
: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {973e8bbf-2ca5-4c7f-a2ac-2672c9bb8041} may be persisted to storage in unencrypted form.
Hosting environment: Production
Content root path: C:\Elay\PublishOutput
Now listening on: http://localhost:30127
Application started. Press Ctrl+C to shut down.
fail: Microsoft.EntityFrameworkCore.Database.Connection[200004]

有什么帮助吗?

最佳答案

在 IIS 中托管 .NET Core 2 应用程序时,您可以向 WebHost.CreateDefaultBuilder() 方法添加一些设置,这些设置将显示详细的错误消息而不是通用的错误消息。

.UseSetting("detailedErrors", "true")

.CaptureStartupErrors(true)

enter image description here

关于asp.net-core-2.0 - 在 IIS 中托管 asp.core 2.0 web api 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47554834/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com