0

I am trying to run this REST API and I keep getting the follwing error:

HTTP Error 500.30 - ANCM In-Process Start Failure

I tried to upgrade .net core to 2.2.5 from 2.2.0 . 2.2.0 was default version with Visual studio. I am coding this in Visual studio 2019.

I also downloaded dotnet hosting bundle from the below web site:

https://dotnet.microsoft.com/download/dotnet-core/2.2

I downloaded the V2.2.5 version and installed SDK, ASP.NET Core Runtime 2.2.5 and .NET Core Runtime 2.2.5 for windows X64.

below is the screen shot.

enter image description here

and below is the screenshot of my dotnet info:

enter image description here

Despite of downloading everything, I kept getting an error :

HTTP Error 500.30 - ANCM In-Process Start Failure

Finally, I changed my csproj file AspNetCoreHostingModel to outofprocesss and then the error changed to process failure so I changed the csproj back to original file.

Currently, my csproj file looks like below:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>

  <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>

  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.4" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Update="Microsoft.NETCore.App" Version="2.2.5" />
  </ItemGroup>

</Project>

My statrtup.cs file looks like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using RecLoadAPI.Models.DB;
namespace RecLoadAPI
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
            services.AddDbContext<db_recloadContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            // app.UseHttpsRedirection();
            app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
            app.UseMvc();
        }
    }
}

I also tried to follow this link, but still getting the same error:

https://stackoverflow.com/questions/53811569/http-error-500-30-ancm-in-process-start-failure

any help will be highly appreciated.

Anjali
  • 2,540
  • 7
  • 37
  • 77
  • If I understand correctly, you host your application within IIS. I suggest starting your application directly via Kestrel without IIS (dotnet "path_to_your_executable_dll" or simply "path_to_you_executable_exe"). If the application starts correctly, the problem is about IIS (ASP_NET Core Module, etc. - see https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-2.2#50030-in-process-startup-failure). If the error persists, you probably get additional output. – metacube Mar 13 '20 at 20:34
  • 2.2 is end-of-life, so you shouldn't use it any more. Once you switch to a supported version and can reproduce this issue, run some basic diagnostics and edit your question to include that, https://docs.jexusmanager.com/tutorials/ancm-diagnostics.html – Lex Li Mar 13 '20 at 23:46

0 Answers0