Skip to content

Commit 0bccdbe

Browse files
authored
Allow C# file to override TargetFramework conditionally
1 parent 1a2413f commit 0bccdbe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ and adding a couple extra properties to the project file:
8181

8282
<PropertyGroup>
8383
<OutputType>Exe</OutputType>
84-
<TargetFramework>net10.0</TargetFramework>
84+
<!-- 👇 allows c# file to override the TF via a #:property -->
85+
<TargetFramework Condition="$(TargetFramework) == ''">net10.0</TargetFramework>
8586

8687
<!-- 👇 additional properties required in package mode -->
8788
<ImportProjectExtensionProps>true</ImportProjectExtensionProps>
@@ -111,7 +112,8 @@ and seamless experience across IDE and CLI builds:
111112

112113
<PropertyGroup>
113114
<OutputType>Exe</OutputType>
114-
<TargetFramework>net10.0</TargetFramework>
115+
<!-- 👇 allows c# file to override the TF via a #:property -->
116+
<TargetFramework Condition="$(TargetFramework) == ''">net10.0</TargetFramework>
115117
</PropertyGroup>
116118

117119
</Project>

0 commit comments

Comments
 (0)