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

Issue with GetTargetFrameworksWithPlatformForSingleTargetFramework target not existing. #502

Open
belav opened this issue Jun 11, 2024 · 2 comments

Comments

@belav
Copy link

belav commented Jun 11, 2024

Describe the Bug

Steps to Reproduce

I can't supply a reproduction repo at this point, but I am just running nugetize against our very large solution with ~100 projects. Looking at replacing dotnet pack with nugetize

That results in

C:\projects\insite-commerce\Src\Backend\Startup\Insite.WebApp\Insite.WebApp.csproj : error MSB4057: The target "GetTargetFrameworksWithPlatformForSingleTargetFramework" does not exist in the project.
C:\projects\insite-commerce\Src\Backend\Insite.SystemViews\Insite.SystemViews.csproj : error MSB4057: The target "GetTargetFrameworksWithPlatformForSingleTargetFramework" does not exist in the project.

I don't see the GetTargetFrameworksWithPlatformForSingleTargetFramework target anywhere in the nugetizer code. I did try adding an empty target <Target Name="GetTargetFrameworksWithPlatformForSingleTargetFramework" /> to the two projects in question. Which gets me further but results in these errors.

C:\projects\insite-commerce\Src\Backend\Startup\Insite.WebApp\Insite.WebApp.csproj : error MSB4057: The target "GetTargetPath" does not exist in the project.
C:\projects\insite-commerce\Src\Backend\Insite.SystemViews\Insite.SystemViews.csproj : error MSB4057: The target "GetTargetPath" does not exist in the project.
C:\projects\insite-commerce\Src\Backend\Startup\Insite.WebApp\Insite.WebApp.csproj : error MSB4057: The target "GetTargetPathWithTargetPlatformMoniker" does not exist in the project.

The projects in question - one is <Project Sdk="Microsoft.NET.Sdk.Web"> and the other is <Project Sdk="Microsoft.NET.Sdk.Razor"> both targeting just net8.0, although the nuget project targets net48 and net8.0.

I do have <IsPackable> set in the Web project and know that dotnet pack is packing it correctly (although not a lot of the dependencies which is why I started looking into nugetizer)

Is it possible that nugetizer doesn't work with these two types of projects? Or would you have any ideas about the original GetTargetFrameworksWithPlatformForSingleTargetFramework problem? From here it seems like that target should be skipped if it doesn't exist. And that target is only in a couple of places in the msbuild repo.

Back this issue
Back this issue

@belav belav added the bug Something isn't working label Jun 11, 2024
@kzu
Copy link
Member

kzu commented Jun 12, 2024

Thanks for reporting the issue. Please consider sponsoring @devlooped so I can prioritize this issue 🙏

@kzu kzu added need info and removed bug Something isn't working labels Aug 7, 2024
@kzu
Copy link
Member

kzu commented Aug 7, 2024

Please provide a minimal repro with the setup for those two projects that would be representative. I haven't been able to repro since the setup/config choices are unknown.

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

No branches or pull requests

2 participants