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

Traversal SDK ignores SetTargetFramework metadata on ProjectReference #582

Open
AArnott opened this issue Oct 18, 2024 · 0 comments
Open

Comments

@AArnott
Copy link
Member

AArnott commented Oct 18, 2024

I have a traversal that is responsible for build and publishing of projects. As such, any references to multi-targeting projects must be referenced with the TargetFramework global property explicitly set, to avoid a build error like this:

C:\Users\User\agent_work_tool\dotnet\sdk\8.0.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets(31,5): error NETSDK1129: The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, you must specify one of the following frameworks in order to publish: net8.0, net8.0-windows10.0.22621.0, net8.0-macOS [C:\Users\User\agent_work\1\s\src\Nerdbank.Zcash.App\Nerdbank.Zcash.App.Desktop\Nerdbank.Zcash.App.Desktop.csproj]

So I set the typical ProjectReference metadata to target just the TargetFramework appropriate for the build agent:

<SetTargetFramework>TargetFramework=net8.0-windows10.0.22621.0</SetTargetFramework>

But this was totally ignored, and the project built without TargetFramework set, and it failed on Publish.

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

No branches or pull requests

1 participant