dotnet / dotnet/msbuild

BuildCheck: Warn when reading Configuration early

Open
#12,792 6 comments 0 reactions 0 assignees View on GitHub
Area: BuildCheck BuildCheck Suggestion triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Summary

Reading Configuration early can be problematic, and can introduce behavior differences between building single project vs building whole solution.

Building a whole solution will set Configuration as a global property, making it available anytime in evaluation (e.g, in Directory.Build.props). But building a single project without explicitly specifying configuration will only have the value available a little bit later and won't be available in Directory.Build.props.

Logic that will try to change output path based on Configuration in Directory.Build.props will suffer from behavior differences between building single project vs building whole solution, which is very bad.

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.