What is Target runtime portable

T.Zacks 3,996 Reputation points
2021-11-26T18:28:15.087+00:00

Just saw this one option called Target runtime portable in VS2022. please tell me

1) what is this option ?
2) when one should select this option?
3) advantage of this option ?

screen shot

152920-p2.png

Developer technologies | C#
{count} votes

3 answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2021-11-26T21:08:58.557+00:00

    From this post : 'portable' --> 'not version-specific' #25729,
    related to .NET RID Catalog, it depends on the OS :

    Windows, not version-specific

    • win-x64
    • win-x86
    • win-arm
    • win-arm64

    Linux, not distribution-specific

    • linux-x64 (Most desktop distributions like CentOS, Debian, Fedora, Ubuntu, and derivatives)
    • linux-musl-x64 (Lightweight distributions using musl like Alpine Linux)
    • linux-arm (Linux distributions running on ARM like Raspbian on Raspberry Pi Model 2+)
    • linux-arm64 (Linux distributions running on 64-bit ARM like Ubuntu Server 64-bit on Raspberry Pi Model 3+)

    macOS, not version-specific

    • osx-x64 (Minimum OS version is macOS 10.12 Sierra)
    2 people found this answer helpful.

  2. Clarence Tunstall 21 Reputation points
    2022-03-22T15:16:09.213+00:00

    It appears portable is as suspected in that it is non architecture specific but requires more JIT time during application start up which could be detrimental for large applications. It controls the types of files that are compiled into the project.

    I found this answer on Stack overflow which led me to other resources:

    https://stackoverflow.com/questions/53860621/what-are-differences-between-portable-and-win-x64-when-deploying

    and this reference:
    https://learn.microsoft.com/en-us/dotnet/core/rid-catalog

    0 comments No comments

  3. Bruce (SqlWork.com) 78,161 Reputation points Volunteer Moderator
    2022-03-22T15:54:01.027+00:00

    Over the years, Microsoft has developed runtime support for .net on many platforms (windows phone, Xamarin, silverlight, and UWP). There has been desire to share code libraries between projects for these platforms. one of the earlier attempts was the portable class library (PCL), which allowed sharing libraries between these platforms. As always, a cross platform library is lowest common denominator api. While code was shared, it is fairly restricted in the apis available. It was designed as a common machine architecture.

    When .net core wanted to share libraries with the 4.8 framework, they wanted broader api support then PCL. The net standard class library was defined. .net standard 2.0 is the last to support .net 4.* frameworks. 2.1 only works with cross platform .net core code and is the last .net standard version.

    when .net 6.0 is the new cross platform framework. all current platforms are being updated to support .net 6. the cross platform library, is now a regular core library.

    some older (dead or on life support) platforms like windows phone, silverlight, and UWP did not make the cut to get upgraded to support .net core libraries. If you want to share code with these platforms your only option is PCL. So creating PCL libraries was added to .net 6.

    You should know when you need a PCL library. Typically you can ignore PCL like other obsolete MS technologies (silverlight, IE, Visual Basic, ...).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.