使用自包含的应用程序之前,您是否必须在系统上安装.net核心?

编程入门 行业动态 更新时间:2024-10-28 01:15:35
本文介绍了使用自包含的应用程序之前,您是否必须在系统上安装核心?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用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核心?

本文发布于:2023-11-14 03:18:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586068.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   核心   您是否   系统   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!