Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: VS and MSBuild/dotnet build produce behave differently with Build Dependencies #10234

Open
msedi opened this issue Jun 13, 2024 · 0 comments
Assignees

Comments

@msedi
Copy link

msedi commented Jun 13, 2024

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

  1. Build Dependencies should be seen as such and not as Project Dependencies
  2. All build tools should behave the same way.

Actual Behavior

  1. Build Dependencies are seen partly as Project Dependencies (MSBuild/dotnet)
  2. Build tools behave differently on different tools

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants