PublishDepsFilePath behavior changed due to single file application support
Version introduced
.NET Core SDK 5.0.100
Old behavior
The MSBuild PublishDepsFilePath property would be the path to the app's deps.json path in the output directory for non single-file applications, and it would be a path in the intermediate directory for single file apps.
New behavior
The PublishDepsFilePath is empty for single file applications and a new IntermediateDepsFilePath specifies the deps.json location in the intermediate directory. Additionally, for non single-file applications, the deps.json file may not be copied to the output directory (the path specified by PublishDepsFilePath) until later in the build.
Reason for change
Partly this was due a refactoring of the publish logic in order to support improved single file apps in .NET 5.
Additionally, the PublishDepsFilePath property is empty for single file apps to help guard against targets that are supposed to rewrite the deps.json file doing so after the deps.json has already been bundled, thus silently not affecting the app.
Recommended action
Targets that rewrite the deps.json file should generally do so using the IntermediateDepsFilePath property.
More details
Discussion of these changes can be found in the following PRs:
dotnet/sdk#11462
dotnet/sdk#11527
Issue metadata
- Issue type: breaking-change
PublishDepsFilePath behavior changed due to single file application support
Version introduced
.NET Core SDK 5.0.100
Old behavior
The MSBuild
PublishDepsFilePathproperty would be the path to the app's deps.json path in the output directory for non single-file applications, and it would be a path in the intermediate directory for single file apps.New behavior
The PublishDepsFilePath is empty for single file applications and a new
IntermediateDepsFilePathspecifies the deps.json location in the intermediate directory. Additionally, for non single-file applications, the deps.json file may not be copied to the output directory (the path specified byPublishDepsFilePath) until later in the build.Reason for change
Partly this was due a refactoring of the publish logic in order to support improved single file apps in .NET 5.
Additionally, the
PublishDepsFilePathproperty is empty for single file apps to help guard against targets that are supposed to rewrite the deps.json file doing so after the deps.json has already been bundled, thus silently not affecting the app.Recommended action
Targets that rewrite the deps.json file should generally do so using the
IntermediateDepsFilePathproperty.More details
Discussion of these changes can be found in the following PRs:
dotnet/sdk#11462
dotnet/sdk#11527
Issue metadata