Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 726
César Desu Avatar asked Jan 18 '19 05:01

César Desu


People also ask

How to fix http error 500 30 ASP net Core app failed to start?

Troubleshooting steps: Check the system event log for error messages. Enable logging the application process' stdout messages. Attach a debugger to the application process and inspect.

What is .NET core shared framework?

NET Core 3.0 or later SDK is installed. The shared framework is the set of assemblies (. dll files) that are installed on the machine and includes a runtime component and a targeting pack. For more information, see The shared framework.


2 Answers

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

One in ConfigureServices method of the startup class:

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

And other in the IdentityHostingStartup :

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

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

Hope this will help you.

like image 171
TanvirArjel Avatar answered Sep 25 '22 13:09

TanvirArjel


What solved this exact error for me (in .NET Core 2.2) on the production IIS server was disabling 32-bit application support in my application pool. Everything worked fine on my local Win10 IIS Express setup.

I published my application from Visual Studio 2019 (Publish > Settings tab) as "Deployment Mode: Framework dependent" and "Target Runtime: win-x64." I'm not sure if the former option matters or not.

To remedy the error on the IIS Server, I needed to go into "Advanced Settings" on my application pool and set "Enable 32-bit Applications" to "False." You can also do this at the global level if it makes sense to. You'll find the global "Advanced Settings" on the right in the "Actions" pane.

like image 34
Sum None Avatar answered Sep 22 '22 13:09

Sum None