Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to TFM support for reference pkg src generator #567

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

mthalman
Copy link
Member

@mthalman mthalman commented Mar 9, 2023

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 a netstandard2.0 TFM, you can get this error:

 error NETSDK1023: A PackageReference for 'NETStandard.Library' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs

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 existing PropertyGroup that sets the output path.

One additional change was made to add netcoreapp3.1 to the excluded TFMs.

Fixes dotnet/source-build#3251

@mthalman mthalman requested a review from ViktorHofer March 9, 2023 17:41
@mthalman mthalman enabled auto-merge March 14, 2023 18:25
@mthalman mthalman disabled auto-merge March 14, 2023 18:25
@mthalman mthalman enabled auto-merge March 14, 2023 18:25
@mthalman mthalman merged commit 8cba211 into dotnet:main Mar 14, 2023
@mthalman mthalman deleted the tfms branch March 14, 2023 18:35
@mthalman
Copy link
Member Author

Sorry, @ViktorHofer. I shouldn't have enabled auto-merge to give everyone a chance to review. Let me know if further changes are needed.

@ViktorHofer
Copy link
Member

Looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SBRPs: lack of support for the netcoreapp3.1 TFM
3 participants