Update ClickOnce targets for publishing deps.json #15316
Merged
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.
Customer Impact
ClickOnce publish fails for projects referencing packages marked as developer dependency because the publishing specific deps.json file that needs to be referenced is not present.
Testing
CTI team has tested the change for the top 50 NuGet packages plus packages specifically affected by the bug.
Risk
Low. Only affects packages that are marked as developer dependency.
Code Reviewer:
johnhart;mslukewest
Description of fix
ClickOnce currently uses PublishDepsFilePath to reference the Publish version of deps.json. The publishing deps.json gets copied to the PublishDepsFilePath when copy targets run at the end of publish build.
However, ClickOnce manifest generation target that references this deps.json runs before the copy targets. This causes ClickOnce target to fail when it tries to access the publishing deps.json instead of the build generate deps.json (conditioned on the _UseBuildDependencyFile property).
The fix is to change the path used to reference the Publish deps.json from PublishDepsFilePath to IntermediateDepsFilePath. The IntermediateDepsFilePath is the intermediate location where the file is generated before its final copy to PublishDepsFilePath.