HTTP错误500.30-ASP.NET Core 2.2中的ANCM进程内启动失败错误 [英] HTTP Error 500.30 - ANCM In-Process Start Failure error in ASP.NET Core 2.2

查看:1138
本文介绍了HTTP错误500.30-ASP.NET Core 2.2中的ANCM进程内启动失败错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在配置此应用程序 确认帐户并在ASP.NET Core中恢复密码 但我有一个错误:

I am configuring this application Confirming the account and recovering passwords in ASP.NET Core but I have an error:

HTTP错误500.30-ANCM进程内启动失败的常见原因 此问题:应用程序无法启动应用程序已启动 但随后停止了应用程序已启动,但在运行期间引发了异常 启动故障排除步骤:检查系统事件日志中是否有错误 消息启用日志记录应用程序进程的标准输出消息 将调试器附加到应用程序进程并检查http 500 在IdentityHostingStartup中替换此代码时

HTTP Error 500.30 - ANCM In-Process Start Failure Common causes of this issue: The application failed to start The application started but then stopped The application started but threw an exception during startup Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach to debugger to the application process and inspect http 500 when replacing this code in IdentityHostingStartup

下面是我的配置:

[assembly: HostingStartup(typeof(Misioneros.Stella.Maris.Web.Areas.Identity.IdentityHostingStartup))]
namespace Misioneros.Stella.Maris.Web.Areas.Identity
{
    public class IdentityHostingStartup : IHostingStartup
    {
        public void Configure(IWebHostBuilder builder)
        {
            builder.ConfigureServices((context, services) => {
                services.AddDbContext<ApplicationDbContext>(options =>
                    options.UseSqlServer(
                        context.Configuration.GetConnectionString("DefaultConnection")));

                services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                })
                    .AddEntityFrameworkStores<ApplicationDbContext>();
            });
        }
    }
}

有什么问题吗?

推荐答案

我明白了原因.可能是您在应用程序中两次注册了Identity,如下所示:

I got the reason. May be you are registering Identity twice in your application as follows:

启动类的ConfigureServices方法之一:

services.AddDefaultIdentity<IdentityUser>()
                .AddDefaultUI(UIFramework.Bootstrap4)
                .AddEntityFrameworkStores<ApplicationDbContext>();

以及IdentityHostingStartup中的其他内容:

services.AddDefaultIdentity<IdentityUser>(config =>
                {
                    config.SignIn.RequireConfirmedEmail = true;
                }).AddEntityFrameworkStores<ApplicationDbContext>();

Identity注册在一个位置,即使用ConfigureServices方法还是IdentityHostingStartup.

Register Identity just in one place i.e either in ConfigureServices method or in IdentityHostingStartup.

希望这会对您有所帮助.

Hope this will help you.

这篇关于HTTP错误500.30-ASP.NET Core 2.2中的ANCM进程内启动失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆