Skip to content

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

@dellis1972

Description

@dellis1972

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions