1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 11:37:04 +09:00
Satori/docs/coding-guidelines
Viktor Hofer 331823f404
Simplify .NETFramework tfms (#58558)
* Simplfy .NETFramework tfms

Libraries which target .NET Framework usually have rid agnostic tfms,
i.e. net461. If the library targets netstandard2.0-windows as well,
the .NET Framework tfm must be rid specific, as rid specific
.NET Framework apps would otherwise pick the .NETStandard asset over
the .NETFramework one (based on the RID compatibility rules)

There is yet another reason that requires .NETFramework tfms to be RID
specific, which is when a project P2Ps other projects which are
rid-specific. Without the RID specific .NETFramework tfm, a compatible
.NETStandard asset would be picked instead.

NuGet doesn't support setting a TargetPlatform in the TargetFramework
alias when targeting .NETFramework or .NETStandard. Any such tfms in
dotnet/runtime are currently leveraging a hack that strips the
TargetPlatform / TargetFrameworkSuffix away during restore and packaging
(as NuGet Pack uses the project.assets.json file).

As NuGet will likely never support RID specific .NETFramework tfm
aliases, the distinction between a RID specific and a RID agnostic
.NETFramework tfm is unnecessary.

Remove all "TargetFrameworkSuffixes" / TargetPlatforms / RIDs
(whatever you would like to call them) from .NETFramework tfms and let
the packaging targets handle the cases where a RID specific asset is
required in the package.

Explictly don't set TargetsWindows to true for .NETFramework builds as
the Targets* properties are infered from the platform / suffix and
many projects make the assumption that net461
(without the "-windows" part) doesn't set TargetsWindows=true.

Fixes https://github.com/dotnet/runtime/issues/58495

* Warn on .NETFramework duplicate runtime assets

* Ignore .NEtFramework non Windows and non empty RIDs

Also cleaning up the packaging.targets file and removing
the ExcludeFromPackage option which isn't needed anymore as
target frameworks aren't excluded from packages produced in
dotnet/runtime anymore.
2021-09-10 09:50:11 +02:00
..
api-guidelines Use [NotNullWhen(true)] in more places (#47598) 2021-01-30 06:09:28 -05:00
adding-api-guidelines.md Upgrade to net7.0 and remove target frameworks (#58011) 2021-09-08 22:04:23 +02:00
breaking-change-definitions.md Fix trailing whitespaces (#40891) 2020-08-19 17:29:01 -07:00
breaking-change-rules.md Fix trailing whitespaces (#40891) 2020-08-19 17:29:01 -07:00
breaking-changes.md Fix trailing whitespaces (#40891) 2020-08-19 17:29:01 -07:00
clr-code-guide.md Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01:00
clr-jit-coding-conventions.md Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01:00
coding-style.md Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
cross-platform-guidelines.md corefx => runtime (#2068) 2020-01-24 09:30:18 -08:00
cross-platform-performance-and-eventing.md .NET Core to .NET branding changes (#33694) 2020-03-28 07:00:19 -07:00
EventLogging.md Find&Replace coreclr/src -> coreclr (#45761) 2020-12-08 10:40:17 -08:00
framework-design-guidelines-digest.md Fix typo in Framework Design Guidelines - Digest (#38307) 2020-06-23 17:04:00 -07:00
interop-guidelines.md Fix indentation on Interop directory tree example (#56718) 2021-08-02 13:17:23 -04:00
libraries-packaging.md Simplify .NETFramework tfms (#58558) 2021-09-10 09:50:11 +02:00
performance-guidelines.md Fix broken MSDN blogs links (#32273) 2020-02-14 08:34:15 -08:00
project-guidelines.md Simplify .NETFramework tfms (#58558) 2021-09-10 09:50:11 +02:00
updating-ref-source.md Remove the use of IsPartialFacadeAssembly in refererences (#52793) 2021-05-19 08:22:04 +02:00