Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 500.30 - ASP.NET CORE app failed to start

Well after publishing the program on IIS, we have this error

HTTP Error 500.30 - ASP.NET Core app failed to start
Common solutions to this issue:
The app failed to start
The app started but then stopped
The app 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 a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265

After we check stdout log file, this Error appears

  at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at ArtanNet.Program.Main(String[] args) in C:\Users\Administrator\Desktop\ArtanNet\ArtanNet\Program.cs:line 16

program.cs file code is:

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

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }

web.congig:

<?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=".\ArtanNet.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: d6cea5f9-6e6d-4f03-b6e9-1d0fb599d508-->

and now please help us to fix this error

like image 733
mohammad rahimi Avatar asked Dec 20 '25 05:12

mohammad rahimi


2 Answers

HTTP Error 500.30 - ASP.NET Core app failed to start is a very generic error message.

To get a more specific exception message you have to set enable ASPNETCORE_DETAILEDERRORS. To do that in Azure Portal follow these steps:

  1. Navigate to the Azure Portal and open your App Service application.
  2. In the left-hand menu, click on "Settings > Environment variables".
  3. Click on the "+ Add" button.
  4. In the "Name" field, enter ASPNETCORE_DETAILEDERRORS (without the quotes).
  5. In the "Value" field, enter true (without the quotes).
  6. Click on the "OK" button to save the setting.

Now when you will open your app an detailed exception will be shown in place of the generic HTTP Error 500.30 - ASP.NET Core app failed to start.

like image 55
FelixB Avatar answered Dec 22 '25 20:12

FelixB


Which Core version are you using? And what Hosting Model you are using? IN Of Process or Out of Process? You can check thios in you csproj file. if you using In of Process, try to change it to

 <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
like image 42
Oliver Dzaeck Avatar answered Dec 22 '25 21:12

Oliver Dzaeck