0

I published my project which I developed in .NET Core 7 version on a web hosting server but I am getting "HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure" error.

    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args).ConfigureAppConfiguration((hostingContext, config) =>
            {
                config.Sources.Clear();
                var env = hostingContext.HostingEnvironment;
                config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                    .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
                config.AddEnvironmentVariables();
                if (args != null)
                {
                    config.AddCommandLine(args);
                }
            })
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            }).ConfigureLogging(logging =>
            {
                logging.ClearProviders();
            });
    }

(https://i.stack.imgur.com/kObVj.png)

First in the log file "Unhandled exception. System.IO.IOException: Failed to bind to address http://127.0.0.1:5000: address already in use." I noticed the error and I configured my launchSettings.Json settings according to the information provided by the hosting company, but I still get the same error. Can you help me?

My web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\VoyagerPortfolio.Mvc.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: b9bce31e-fe26-4a19-88b7-2a46b76f9a49-->
Progman
  • 16,827
  • 6
  • 33
  • 48
CNone
  • 1
  • 3
  • Have a look at [this](https://stackoverflow.com/questions/54755562/http-error-502-5-ancm-out-of-process-startup-failure-after-upgrading-to-asp-ne) . Besides, make sure having the corresponding AspNetCore module installed in IIS . – Qing Guo Mar 28 '23 at 06:26

1 Answers1

0

Problem solved. I have configured my codes in program.cs. I have provided my web.config settings on the hosting server. I examined the logs and finally installed the Microsoft.SqlServer.Server package.

CNone
  • 1
  • 3