microsoft / microsoft/vs-solutionpersistence

[Feature Request] Add Support for MSBuild Conditionals and Properties.

Open
#128 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
213
Forks
14
PR merge metrics
No merged PRs in 30d

Description

It would be very handy to be able to use MSBuild Conditional statements and MSBuild Properties within the slnx file.
This would allow for conditional inclusion or exclusion of projects and also to allow paths to dependent projects be configurable.

<Solution>
  <Configurations>
    <Platform Name="Any CPU" />
  </Configurations>
  <Project Path="C\C.csproj" Condition="Exists('C\C.csproj')" />
  <Project Path="B\B.csproj" />
  <Project Path="A\A.csproj">
    <BuildDependency Project="B\B.csproj" />
    <BuildDependency Project="C\C.csproj" Condition="Exists('C\C.csproj')"/>
  </Project>
</Solution>

or

<Solution>
  <Configurations>
    <Platform Name="Any CPU" />
  </Configurations>
  <Project Path="$(PathToC)\C.csproj" Condition="Exists('$(PathToC)\C.csproj')" />
  <Project Path="B\B.csproj" />
  <Project Path="A\A.csproj">
    <BuildDependency Project="B\B.csproj" />
    <BuildDependency Project="$(PathToC)\C.csproj" Condition="Exists('$(PathToC)\C.csproj')"/>
  </Project>
</Solution>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the repository's .slnx solution models and parsing or serialization entry points, then compare how the XML examples represent projects and build dependencies. The work is done when MSBuild Conditions and Properties can control project inclusion, dependency inclusion, and configurable paths as shown in the issue, with behavior verified by the repository's tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.