Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

an error occurred while starting the application after publishing dot net core 2 app

After publishing my .net core 2 app on IIS 7.5 I get this error:

an error occurred while starting the application.

Is there any way to force dot net core to submit a accurate error message rather than such general message?

like image 929
Ehsan Zargar Ershadi Avatar asked Apr 05 '18 08:04

Ehsan Zargar Ershadi


People also ask

Is .NET Core 2.2 still supported?

As a non-LTS (“Current”) release, it is supported for three months after the next release. . NET Core 3.0 was released on September 23, 2019. As a result, . NET Core 2.2 is supported until December 23, 2019.

Is .NET Core 2.1 still supported?

NET Core 2.1 will be reaching end of support on August 21, 2021 and after this date we will no longer provide updates including security fixes, or technical support for this version. We strongly recommend you migrate your applications to . NET Core 3.1 or later before this date.

What is app run () in .NET core?

The Run Extension method is used for adding terminal middleware that means Adds a terminal middleware delegate to the application's request pipeline. This method takes two Parameters: app: The Microsoft. AspNetCore. Builder.


Video Answer


2 Answers

I found this link helpful: How to troubleshoot: “An error occurred.... In summary:

  1. In the <aspNetCore> element of your web.config, set stdoutLogEnabled to true.
<aspNetCore processPath=".\myapp.exe"
            stdoutLogEnabled="true"
            stdoutLogFile=".\logs\stdout" />
  1. Create your log folder.

    Example: Given stdoutLogFile=".\logs\stdout", create logs\ in your application root directory. .\logs\ is the directory where logs will be stored, and is configurable to your preference. stdout is a static value that'll be prepended to all file names in the log folder.

  2. Run your request and open the log file.

Additional information on the ASP.NET Core module: ASP.NET Core Module

Don't forget to disable logging once done!

like image 125
Billy Jo Avatar answered Oct 22 '22 07:10

Billy Jo


You can try to start your application directly on your IIS Server via the console.

dotnet myapp.dll

You should get a much more verbose error there.

like image 45
Yush0 Avatar answered Oct 22 '22 07:10

Yush0