[Bug]: VS and MSBuild/dotnet build produce behave differently with Build Dependencies #10234
Labels
bug
Documentation
Issues about docs, including errors and areas we should extend (this repo and learn.microsoft.com)
Priority:2
Work that is important, but not critical for the release
triaged
Issue Description
VS allows to have build dependencies, that allows to build additional projects next to the main project to ensure satellite projects are also built. This is especially necessary when a project is indirectly dependent on another project. Wheres a project references copy they output of the dependent project to the consuming project, build dependencies just build all dependent projects do not copy the output to the consuming/main projects.
You have to configure the build dependency in the solution.
When building inside Visual Studio this behavior is correct. The projects are build and no dependencies are copied.
When building with MSBuild/dotnet build dependencies are seen as project references, but not completely (only a few components are copied to the consuming project, but not the same way as having a real project reference).
This is especially a problem when people are using VS push their changes to the build agent and get a different behavior.
It took us quite a while to find out what the problem really was.
#2274 seems to be related.
Steps to Reproduce
I have attached a demo example to reproduce the behavior.
Dependencies.zip
Expected Behavior
Build Dependencies
should be seen as such and not asProject Dependencies
Actual Behavior
Build Dependencies
are seen partly asProject Dependencies
(MSBuild/dotnet)Analysis
I don't know the details, but setting
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
seems to solve the problem.
Versions & Configurations
.NET 8 / Visual Studio 2022 17.11 (Preview 2)
But it does not seem to a problem of the preview.
The text was updated successfully, but these errors were encountered: