Asp.net-core – HTTP Error 500.30 – ANCM In-Process Start Failure error in ASP.NET Core 2.2

asp.net-coreasp.net-core-2.2asp.net-core-identity

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

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

Below is my configuration:

[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>();
            });
        }
    }
}

Any idea what is the problem?

Best Answer

I've had the 500.30 error due to the duplicate identity problem cited by TanvirArjel, but I also just encountered the error when my appsettings.json file had some bad JSON in it. Not sure if that would only occur if you're actually trying to use configuration values in Startup.