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-->