Fix publishing in VS when runtime identifier in publishing profile differs from project rid #4205
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.
Description
1: In Visual Studio, publishing with a publishing profile that contains a runtime identifier which differs from the runtime identifier in the project results in a publish failure.
In this scenario, VS overrides 'ProjectToOverrideProjectExtensionsPath'. The parent WPF project must set the
MSBuildProjectExtensionsPath
of the child project. (See Sdk.props:35).2: A
Directory.Build.Props
that usesMSBuildProjectName
to setIntermediateOutputPath
will cause the temporary local type assembly to not be found.The parent targets assumes the assembly will be placed in the
IntermediateOutputPath
of the parent, not theIntermediateOutputPath
of the child project. Return the assembly location from_CompileTemporaryAssembly
so these paths no longer need to match.Customer Impact
Breaks some publishing profiles in VS and a fairly common usage of directory.build.props for solutions with a large number of projects.
Regression
Yes. This is a regression when PackageReference support in WPF is enabled.
Testing
Repro'd the publish failure in VS, applied the change, and verified publishing was working.
Repro'd the missing assembly, applied the change, and verified the project compiled.