Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<TargetsWindows Condition="'$(OS)' == 'Windows_NT' AND '$(OSGroup)' == ''">true</TargetsWindows>
<TargetsWindows Condition="'$(OS)' != 'Windows_NT' AND '$(OSGroup)' == ''">false</TargetsWindows>
<TargetsWindows Condition="'$(OSGroup)' == 'Windows_NT'">true</TargetsWindows>
Expand Down Expand Up @@ -111,4 +110,25 @@
<PropertyGroup>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
</PropertyGroup>

<!--
For non-.NET, we explicitly set the C# language version to 13. This matches
the language version used by the .NET 9 SDK, and provides helpful modern
language features. While this isn't strictly supported by .NET in general,
it works well in practice. There are very few C# language features that
depend on SDK APIs, and we avoid them.

For .NET, we omit this property entirely, which results in the SDK choosing
the C# language version that matches the .NET version.

Details here:

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-versioning

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version
-->
<PropertyGroup
Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))' != '.NETCoreApp'">
<LangVersion>13.0</LangVersion>
</PropertyGroup>
</Project>
Loading