Ich versuche, meine asp.net Core 2-Anwendung auf Debian Linux zu veröffentlichen, und ich stehe vor Schwierigkeiten..net Core 2-Anwendung wird erfolgreich ausgeführt, aber die veröffentlichte App nicht ausgeführt
Während ich versuche, das Problem zu verstehen, erstelle ich eine leere Konsole Anwendung in bash (Windows-Subsystem für Linux, Ubuntu), ich führe es erfolgreich, ich veröffentliche es und führe die veröffentlichte Datei aus, es schlägt fehl.
/mnt/c/Work/Temp/lin2# dotnet new Console
/mnt/c/Work/Temp/lin2# dotnet run
Hello World!
/mnt/c/Work/Temp/lin2# dotnet publish -c Release --self-contained --runtime linux-x64 -o /mnt/c/Temp/lin2
/mnt/c/Work/Temp/lin2# /mnt/c/Temp/lin2/lin2.dll
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.
The <OutputType>Exe</OutputType>
eingestellt (Standard), aber die kompilierte Assembly hat dll
Dateierweiterung. Ich habe versucht, zu googeln, wie exe
Datei zu erstellen, aber die meisten Antworten beziehen sich auf alte project.json
Format.