如何确定要使用的运行时ID? [英] How do I decide what runtime id to use?

查看:126
本文介绍了如何确定要使用的运行时ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯于使用点网框架构建可以释放
的.exe文件,但是在.Net Core 2.0中,我需要在创建.exe时指定运行时ID

I am used to the dot net framework building a .exe file that I can release However in .Net Core 2.0 I need to specify a runtime id when creating the .exe

例如

dotnet publish --runtime win7-x84

运行时ID为win7
选择运行时ID时应考虑哪些因素?

where the runtime id is win7 What factors should I consider when choosing the run time id?

我是否需要发布多个.exe版本以适应不同操作系统上的客户端?

Do I need to be releasing multiple .exe versions to cater for my clients on different operating systems?

我看过此处的文档

推荐答案


选择运行时ID时应考虑哪些因素?

What factors should I consider when choosing the run time id?

那么,您应该考虑的主要因素是目标操作系统,将在其中启动应用程序。 .NET Core 2.0添加了对可移植RID的支持之后,一切变得简单得多。便携式RID不包含操作系统详细信息,例如: win-x64 linux-x86 。如果操作系统属于一个平台(Windows或Linux),则可以发布将在该系列的所有OS上运行的应用程序的一种版本。因此,要为整个x64 Windows OS系列构建应用程序,请运行以下 publish 命令:

Well, the main factor you should consider is a target Operating System, where the application will be launched. Everything became much simpler after .NET Core 2.0 added support of portable RIDs. Portable RIDs do not include OS details, e.g.: win-x64 or linux-x86. If operating systems belong to one platform (Windows or Linux) you could publish one version of application that will run on all OS from the family. So to build application for whole family of x64 Windows OS run the following publish command:


dotnet发布-配置发布-运行时win-x64

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






我是否需要发布多个.exe版本以适应不同操作系统上的
客户端?

Do I need to be releasing multiple .exe versions to cater for my clients on different operating systems?

根据以上解释,一个家族中的不同OS不需要单独的版本。您不需要为win7,win8,win10等构建新版本。但是,您仍然需要发布两个应用程序版本以支持x86和x64体系结构。只能构建一个可以同时在x32和x64上运行的x32版本。但是,它将在x64 OS上以32位模式运行。

According to above explanation, there is no need in separate versions for different OS within one family. You don't need to build new versions for win7, win8, win10, etc. However you still need to publish two application versions for support of x86 and x64 architectures. It is possible to build only one x32 version that will run on both x32 and x64. However it will run in 32-bit mode on x64 OS, which should be avoided.

此问题包含许多其他有关不同RID与操作系统之间兼容性的详细信息。自从引入便携式RID以来,大多数这种方法已经过时了,但是仍然有很多有用的信息。

This question contains a lot of other details about compatibility between different RIDs and OS. Much of this outdated since portable RIDs were introduced but there is still plenty of useful info.

这篇关于如何确定要使用的运行时ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆