Kirsten
Kirsten

Reputation: 18076

How do I decide what runtime id to use?

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

for example

dotnet publish --runtime win7-x84

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

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

I have looked at the document here

Upvotes: 2

Views: 767

Answers (1)

CodeFuller
CodeFuller

Reputation: 31282

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

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 publish --configuration Release --runtime win-x64

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

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.

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.

Upvotes: 1

Related Questions