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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With