Do you have to have .net core installed on a system before using self contained apps?

后端 未结 2 636
清酒与你
清酒与你 2021-01-28 08:39

I\'m using Visual Studio 2019 to publish a self contained .net core 2.1 app. Many files are emitted during the publishing (application files as well as core libraries).

2条回答
  •  天命终不由人
    2021-01-28 09:26

    A self-contained app will contain everything needed to run the app.

    To run the app, there is no dotnet.exe but an executable named as your app. So

    dotnet publish myapp.csproj -r win-x64
    

    will create a myapp.exe by default.

    For linux runtimes (e.g. -r linux-x64) the executable will be extension less and is supposed to be run as ./myapp.

    You only need to install .NET Core components if you want to host a self-contained ASP.NET Core application from IIS, since you will need an IIS module to bootstrap the application. You can use this approach though to run newer or preview versions of the .NET Core runtime that you don't want to install globally.

提交回复
热议问题