Updates to TFM support for reference pkg src generator #567
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.
In order to support packages with net6.0 TFM, we need to ensure that
DisableImplicitFrameworkReferences
is set to false (it's set to true by default) so that it compile against the existing targeting pack. There already existed code to set this to false but it was done globally for the entire project based on the presence of certain TFMs. But applying it for all TFMs is problematic because it can lead to build errors. For example, if applied to anetstandard2.0
TFM, you can get this error:The solution is to conditionally apply the setting of the
DisableImplicitFrameworkReferences
property based on the target framework. I've made changes to incorporate this with an existingPropertyGroup
that sets the output path.One additional change was made to add
netcoreapp3.1
to the excluded TFMs.Fixes dotnet/source-build#3251