dotnet / dotnet/msbuild

[Bug]: Defining a project configuration for one project disables project negotiation for the whole solution graph

Open
#8,854 4 comments 0 reactions 0 assignees View on GitHub
Area: Static Graph bug Partner request triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description

Defining a project configuration for one project in a solution turns off dynamic platform negotiation for all projects in the solution graph.

This is because the conditional to turn off dynamic platform negotiation is

'$(CurrentSolutionConfigurationContents)' == '' turns off negotiation on to broad of a level and this should instead be done on a per project basis.

### Steps to Reproduce

Create a solution that references projects outside of that solution.
define a configuration for all projects in the solution
Make sure there is a need for negotiation in the inside to outside solution reference IE x64->AnyCPU
Build said solution.

the inner to outer solution dependency will not do negotiation and therefore not build as AnyCPU

### Expected Behavior

If a project does not have a configuration in a solution, platform negotiation should take place regardless of other projects configuration.

### Actual Behavior

If a project does not have a configuration in a solution, but other projects do, platform negotiation will not take place for the project without a configuration.

### Analysis

I believe '$(CurrentSolutionConfigurationContents)' == '' can be removed from this conditional since we already check for setplatforms on the individual project level

### Versions & Configurations

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.