Skip to content

Commit baf6674

Browse files
committed
Set version of language according to dotnet version
- C# 14 for net10 - C# 12 as default (net8.0)
1 parent 3b836a3 commit baf6674

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Directory.Build.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> <!-- the property -->
6464
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">$(DO_TargetFrameworks)</TargetFrameworks> <!-- env var -->
6565
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net8.0;net10.0</TargetFrameworks> <!-- fallback to default -->
66+
<LangVersion>12.0</LangVersion> <!-- default language for net8.0 -->
6667
</PropertyGroup>
6768

6869
<PropertyGroup Condition = "$(Configuration.Contains('Debug')) == 'true'">
@@ -75,10 +76,12 @@
7576
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
7677
</PropertyGroup>
7778

79+
<PropertyGroup Condition="'$(TargetFramework)'=='net10.0'">
80+
<LangVersion>14.0</LangVersion> <!-- default language for net10.0 -->
81+
</PropertyGroup>
7882
<PropertyGroup>
7983
<NoLogo>true</NoLogo>
8084
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
81-
<LangVersion>12.0</LangVersion> <!-- version assigned to net8.0 -->
8285
<SolutionDir Condition="$(SolutionDir) == ''">$([MSBuild]::EnsureTrailingSlash(
8386
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'Orm.sln'))))</SolutionDir>
8487
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

0 commit comments

Comments
 (0)