我正在使用Visual Studio 2019发布自包含的 core 2.1应用程序.发布期间会发出许多文件(应用程序文件以及核心库).
I'm using Visual Studio 2019 to publish a self contained core 2.1 app. Many files are emitted during the publishing (application files as well as core libraries).
但是发布的文件中没有包含dotnet.exe.没有dotnet.exe,我将无法启动已发布的应用程序!
But there is no dotnet.exe included in the published files. Without a dotnet.exe I can't launch the published app!
所以我很困惑.必须安装一个系统范围的内核才能使用独立的应用程序,如果是这样,那么您肯定不是独立的应用程序.
So I'm confused. Must you have a system wide core installed to use self-contained apps, and if so, then you're app certainly isn't self contained.
推荐答案一个自包含的应用程序将包含运行该应用程序所需的所有内容.
A self-contained app will contain everything needed to run the app.
要运行该应用程序,没有 dotnet.exe ,而是一个名为应用程序的可执行文件.所以
To run the app, there is no dotnet.exe but an executable named as your app. So
dotnet publish myapp.csproj -r win-x64将默认创建一个 myapp.exe .
对于linux运行时(例如 -r linux-x64 ),可执行文件的扩展名将减少,并且应以 ./myapp 的身份运行.
For linux runtimes (e.g. -r linux-x64) the executable will be extension less and is supposed to be run as ./myapp.
如果要从IIS托管独立的ASP.NET Core应用程序,则仅需要安装.NET Core组件,因为您将需要IIS模块来引导该应用程序.不过,您可以使用这种方法来运行不想在全球范围内安装的.NET Core运行时的更新版本或预览版本.
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.
更多推荐
使用自包含的应用程序之前,您是否必须在系统上安装.net核心?
发布评论