6

I'm building a new web application with ASP.NET Core, and have it running nicely in debug in Visual Studio.

I've added Serilog, using the rolling file sink, and that's working nicely too, from Visual Studio.

Then I've published the app (both directly from VS, but also using AppVeyor), and I've copied it to my web-server, added a site in the IIS etc.

Now I'm getting "500 - Internal server error.".

No logs are written to the filesystem, not even the stdout files. I've added the folders, I've added write permissions for the IIS_IUSRS account and the app pool account.

Still no logs!

Trying to run the site from the commandline works just fine, and logging with Serilog works.

So this has to do with the IIS somehow? But without any logs, it's hard to know what the problem is. Any ideas?

Bonus info:

I've installed the dotnet-sdk-2.1.200-win-x64 package on the server.

The web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\MySite.dll" stdoutLogEnabled="true" stdoutLogFile=".\app_data\stdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: B9DE9F34-1A9E-4D35-B6CE-74209A6CB9FA-->

Permissions on the site's root folder (same for app pool user):

Root permissions

app_data permissions (below are the logs and stdout folders), same for both users:

app_data permissions

Update

I've just installed the AspNetCore.2.0.7.RuntimePackageStore_x64 and dotnet-runtime-2.0.7-win-x64 but it's still not working.

Steen Tøttrup
  • 3,755
  • 2
  • 22
  • 36

2 Answers2

0

I've experienced this similar error as well, but I've found out that I need an updated Dotnet SDK Runtime Installer version 2.0.6+

You can find it here (.NET Core Runtime 2.0.6 Download Page)

Restart your server after the installation.

I hope this helps you.

mark333...333...333
  • 1,270
  • 1
  • 11
  • 26
0

It ended up being the 'Hosting Bundle Installer' I was missing, it was not enough with the other mentioned packages. Installing the latest one, 2.0.8, and restarting did the trick.

Now Serilog is also logging.

Steen Tøttrup
  • 3,755
  • 2
  • 22
  • 36