How to compile a .NET Core 2 MVC web application in EXE?

I want to create a Kestrel standalone .exeDotNetCore 2.0 MVC Web API application in Visual Studio 2017, however I cannot find any documentation. About how to compile it as standalone .exe(without using dotnet run).

Microsoft documentation here: https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/deploy-with-vs covers only the console application, and after changes to .csproj it doesn't matter

<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>

(note that this is not a .NET Core 1.x issue)

+4
source share
2 answers

dotnet publish .Net Core. .

- (, csproj) :

dotnet publish --configuration Release --runtime win-x64

, . , .

+5

:

single. DLL , ILMerge ( , , , )

.NET Core:

  • " " / ", " , dotnet , XYZ.runtimeconfig.json , . (windows, linux, mac)
  • " " : (, yourapp.exe). ( ) . , dll . XYZ.runtimeconfig.json , ( "" app.config ).

CoreRT runtime - , - , , - .

(-) 6 , , CoreRT .

:

  • .NET Core, ..NET Core .

  • , .NET Core, .NET Core, .

:

  • .NET Core , , .

  • , .NET Core, .

  • .NET Core , .NET Core.

, , Microsoft , Visual Studio, , dotnet . , ASP.NET Core, .

, .exe, () EXE .NET Core.

+3

Source: https://habr.com/ru/post/1692073/


All Articles