Revert 'Opt into IncludePackageReferencesDuringMarkupCompilation' #15790
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Revert #15465
https://developercommunity2.visualstudio.com/t/wpf-app-may-fail-to-build-or-publish/1334426
Description
Publishing self contained WPF projects is failing as a result of WPF’s new source generator/package reference support, which the SDK opted into by setting the
IncludePackageReferencesDuringMarkupCompilation
flag. The fix is to revert this property change.Customer Impact
Users are unable to publish some WPF projects self contained. With this fix publishing will succeed and users will still be able to use new WPF source generator support but will have to opt in manually.
Background
The WPF build process creates a temporary project which is built in order to do the markup compilation. In order to support source generators (among other scenarios), we enabled a mode that would import more of the .props and .targets files than the original project imported. However, since the temporary project has a different name, this breaks logic that depends on MSBuild properties that include the project name, such as MSBuildProjectName.
Regression?
Yes
Risk
Low