Skip to content

Commit ec6b4cf

Browse files
committed
Default SolutionDir/SolutionName for standalone project builds
1 parent 109c888 commit ec6b4cf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
<!-- Work around https://github.com/dotnet/sdk/issues/51265#issuecomment-3407578810 -->
2222
<RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>
2323
</PropertyGroup>
24+
<!-- This directory contains two solutions (Verify.slnx and VerifyDangling.slnx), so Verify cannot
25+
auto-discover the solution when a project is built outside of a solution context. Default to the
26+
primary solution so standalone project builds resolve SolutionDirectory/SolutionName correctly.
27+
Solution builds pass these as global properties, which take precedence over these defaults. -->
28+
<PropertyGroup Condition="'$(SolutionDir)' == '' Or '$(SolutionDir)' == '*Undefined*'">
29+
<SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
30+
<SolutionName>Verify</SolutionName>
31+
</PropertyGroup>
2432
<ItemGroup>
2533
<Using Include="System.Diagnostics.CodeAnalysis" />
2634
<Using Include="System.Globalization" />

0 commit comments

Comments
 (0)