Don't set "platform library" for .NET Core 3.0 and higher #3019
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't try to exclude files from the platform library on .NET Core 3.0 and higher, which uses runtime and targeting packs instead
Fixes #3004
To help verify whether this is safe, I looked at the places where
MicrosoftNETPlatformLibrary
is used:GenerateDepsFile
,GenerateRuntimeConfigurationFiles
, andResolveCopyLocalAssets
tasks. These all simply pass it toLockFileExtensions.CreateProjectContext
. In that method, it's used as part of the check to determine if the app is framework dependent:ResolveFrameworkReferences
should addRuntimeFramework
items, so theisFrameworkDependent
calculation should still work.ProjectContext
, theGetRuntimeLibraries
method excludes assets from the platform library for framework dependent apps.GenerateRuntimeConfigurationFiles
task also uses the platform library from theProjectContext
in order to write the runtimeconfig file, but only if there aren't anyRuntimeFrameworks
.ResolvePackageAssets
task excludes assets from the platform library inGetPlatformPackageExclusions
. (It also excludes assets from libraries matching names ofRuntimeFrameworks
, which I believe we should now remove, as those assets will come from runtime packs and won't be in the assets file anyway now)._RestoreCrossgen
andPrepforRestoreForComposeStore
use the platform library name. These are both part of support fordotnet store
, which we are considering dropping, and which will need a lot of work in any case if we want it to work when targeting .NET Core 3