Skip to content

Conversation

gekka
Copy link

@gekka gekka commented Sep 28, 2025

… override

Fixes #11150

Description

Properties explicitly set in the temporary project file are incorrectly override by Directory.Build.props.

This pull request addresses an issue where properties explicitly defined in temporary project files were unintentionally overridden by values from Directory.Build.props.

This fix will cause the import element for SDK.props to be written to the temporary project file before PropertyGroup elements.

Customer Impact

The build cannot be completed successfully.
Known workarounds are incompatible with the code generator.

This fix improves reliability in build environments that rely on temporary project files, such as automated tooling or SDK-generated projects.

Regression

This may be a regression that occurred in .NET 9, according to #10068.

Testing

I placed the built PresentationBuildTasks.dll in C:\Program Files\dotnet\sdk\9.0.304\Sdks\Microsoft.NET.Sdk.WindowsDesktop\tools\net472 and confirmed that I can build WPF project from Visual Studio and msbuid.exe .

Sample repository

Risk

Build behavior breaks only if the old code author intended to pass a properties (IntermediateOutputPath, BaseIntermediateOutputPath, MSBuildProjectExtensionsPath, and _TargetAssemblyProjectName) to the Sdk.props.

Microsoft Reviewers: Open in CodeFlow

@gekka gekka requested a review from a team as a code owner September 28, 2025 08:29
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect SDK import order in temporary project file
1 participant