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

Put package assets in TFM-specific folder #58995

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Nov 15, 2024

Fixes #58990
Related: NuGet/Home#6932

When a package has a build or buildmultitargeting folder without a TFM subfolder, NuGet considers it to be compatible with any TFM. This is causing builds that should be failing with restore errors, to instead later hit a less helpful runtime error.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 15, 2024
@wtgodbe
Copy link
Member Author

wtgodbe commented Nov 15, 2024

@wtgodbe wtgodbe mentioned this pull request Nov 15, 2024
1 task
@adityamandaleeka
Copy link
Member

Thanks for reporting this @loganmj and thanks @BrennanConroy and @wtgodbe for the quick investigation/fix!

Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ApiDescription.Server need a similar treatment?

@wtgodbe
Copy link
Member Author

wtgodbe commented Nov 19, 2024

Does ApiDescription.Server need a similar treatment?

It does, nice catch. Plus I need to fix up Microsoft.AspNetCore.Identity.UI. Will do that today

@wtgodbe
Copy link
Member Author

wtgodbe commented Nov 19, 2024

Actually, not sure if we can fix APIDescription.Server since it targets netcoreapp2.1, $(DefaultNetCoreTargetFramework), and $(DefaultNetFxTargetFramework), and the files in build/buildMultiTargeting are meant to be used on any of those. @ericstj how has dotnet/runtime solved similar problems (packages with non-TFM'd build folders are considered compatible with any TFM by nuget)

@ericstj
Copy link
Member

ericstj commented Nov 19, 2024

We make sure to use TFMs with all assets, including build, buildTransitive.

I don't think an of our packages use buildMultiTargeting -- I can see why you can't use a framework folder there since it's part of the outer build. I think in that case you'd want to make sure your targets raised the appropriate Diagnostics when used in an unsupported project type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors after updating packages
5 participants