E.g.
netstandard2.0
(from Supported target frameworks) which is used as <TargetFramework>
in *.csproj
files or as folder name in NuGet packages internal structure,
and
.NETStandard,Version=v2.0
which is accepted by System.Runtime.Versioning.FrameworkName
class's constructor or can be a value of TargetFrameworkAttribute.FrameworkName
.
How to convert those strings from one form to another? At least one (any) direction.
You can use the source code of NuGet.Frameworks:
Here is the method that converts TFM to FrameworkName: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs#L575
(e.g.
netstandard2.0
to.NETStandard,Version=v2.0
)UPDATE #1
The good news is that it is available as a NuGet package: https://www.nuget.org/packages/NuGet.Frameworks/
Here is a .NET 6 Console Application:
The output will be: