cake-build / cake-build/cake

MSBuild ProjectParser only parses default configuration OutputPath

Open
#1,255 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

### What You Are Seeing?

MSBuild ProjectParser only parses settings for the default build configuration (normally Debug). E.g. OutputPath is by default different for Debug/Release in a Visual Studio project.
### What is Expected?

All build configurations and their OutputPaths are accessible in the ProjectParserResult.
### What version of Cake are you using?

0.15.2+Branch.main.Sha.c2ca4f7ca51c59dc9c47c9830125b4e66cf14e7a

The piece of code handling this is here: https://github.com/cake-build/cake/blob/develop/src/Cake.Common/Solution/Project/ProjectParser.cs#L84
It explicitly only reads OutputPath from the PropertyGroup that matches the default Configuration. For example, this is how a typical (redacted) VS project XML looks:

``` xml

Debug

bin\Release\

bin\Debug\

```

The code will read the value of the initial Configuration element, then parse the PropertyGroups and pick the one that has a matching condition.

I'm not sure what I think the most appropriate solution for this would be. Perhaps add a dictionary to ProjectParserResult, of type `IDictionary` with the Configuration names and OutputPaths?

Contributor guide

Open the contributing guide

Research direction

Start in src/Cake.Common/Solution/Project/ProjectParser.cs around line 84 and inspect how configuration conditions and OutputPath are parsed. Determine how ProjectParserResult should expose all configuration-specific output paths, then verify that Debug and Release values are both accessible.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.