R
R
Roman Rakzin2017-04-08 23:24:06
ASP.NET
Roman Rakzin, 2017-04-08 23:24:06

Why do I get a 500 server error when I run the AspNet Core project exe file?

If I start with Visual Studio, then the project starts.
If I run the binary, the file is launched, but the server gives an error 500.
The project contains a standard MVC router taken from the Microsoft "box".
If I run the standard HelloWorld, then the binary starts and everything works.
But when you add a router, something changes and the project then works only through the open Visual Studio, and by itself it stops working normally.
What can be wrong?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2017-04-09
@TwoRS

See the logs, if not enabled in the Startup class, then enable them.
Add to the Configure method

loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

and in appsettings.json
"Logging": {
        "IncludeScopes": false,
        "LogLevel": {
            "Default": "Verbose",
            "System": "Information",
            "Microsoft": "Information"
        }
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question