Skip to content

Commit 08d0bd9

Browse files
kasperk81kasperk81kasperk81
authored
remove explicit LangVersion from a few projects (#75806)
* remove explicit LangVersion from a few projects * feedback * net7.0 * net7.0 Co-authored-by: kasperk81 <kasperk81 [email protected]> Co-authored-by: kasperk81 <kasperk81 kasperk81 [email protected]>
1 parent e1a9948 commit 08d0bd9

File tree

9 files changed

+7
-19
lines changed

9 files changed

+7
-19
lines changed

src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
<PackageReleaseNotes>$(Description)</PackageReleaseNotes>
2222
<RootNamespace>Microsoft.Diagnostics.Tools.Pgo</RootNamespace>
2323
<RollForward>Major</RollForward>
24-
<!-- TODO Remove the language version limitation when the reference assemblies
25-
are updated with the new scoped keyword. -->
26-
<LangVersion>10</LangVersion>
2724
</PropertyGroup>
2825

2926
<ItemGroup>

src/libraries/Common/tests/StaticTestGenerator/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,10 @@ public static void Main(string[] args)
199199

200200
// Write out the associated .csproj
201201
string csprojPath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(testAssemblyPath) + "-runner.csproj");
202+
Version version = Environment.Version;
202203
File.WriteAllText(
203204
csprojPath,
204-
CSProjTemplate
205+
GetCsprojTemplate($"net{version.Major}.{version.Minor}")
205206
.Replace("#HelperAssemblyLocation#", Path.GetDirectoryName(testAssemblyPath) + Path.DirectorySeparatorChar)
206207
.Replace("#TestAssembly#", Path.GetFullPath(testAssemblyPath))
207208
.Replace("#TestAssemblyLocation#", testAssemblyPath));
@@ -1127,13 +1128,11 @@ public void WriteLine(string format, params object[] args)
11271128
}
11281129
";
11291130

1130-
/// <summary>The template for the .csproj.</summary>
1131-
private const string CSProjTemplate =
1132-
@"<Project Sdk=""Microsoft.NET.Sdk"">
1131+
private string GetCsprojTemplate(string targetFramework) =>
1132+
$@"<Project Sdk=""Microsoft.NET.Sdk"">
11331133
<PropertyGroup>
11341134
<OutputType>Exe</OutputType>
1135-
<TargetFramework>net5.0</TargetFramework>
1136-
<LangVersion>preview</LangVersion>
1135+
<TargetFramework>{targetFramework}</TargetFramework>
11371136
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
11381137
<NoWarn>IDE0049</NoWarn> <!-- names can be simplified -->
11391138
</PropertyGroup>

src/libraries/Common/tests/StaticTestGenerator/StaticTestGenerator.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<EnableDefaultItems>false</EnableDefaultItems>
6-
<LangVersion>preview</LangVersion>
76
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
87
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
98
<NoWarn />

src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<NoWarn>$(NoWarn);SA1205;CA1845</NoWarn>
77
<EnableTrimAnalyzer Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">false</EnableTrimAnalyzer>
88
<IsPackable>true</IsPackable>
9-
<!-- Lifetime rules introduced in C# 11 impact scenarios in net6 framework -->
10-
<LangVersion Condition="'$(TargetFramework)' == 'net6.0'">10</LangVersion>
119
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
1210
<PackageDescription>Provides Classes that allow you to decouple code logging rich (unserializable) diagnostics/telemetry (e.g. framework) from code that consumes it (e.g. tools)
1311

src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
5-
<LangVersion>preview</LangVersion>
65
<Nullable>enable</Nullable>
76
<EnablePreviewFeatures>True</EnablePreviewFeatures>
87
</PropertyGroup>

src/libraries/System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
4-
<LangVersion>10.0</LangVersion>
54
<NoWarn>$(NoWarn);CS3001</NoWarn>
65
</PropertyGroup>
76

src/libraries/System.Text.RegularExpressions/tools/GenerateRegexCasingTable.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
6-
<LangVersion>latest</LangVersion>
5+
<TargetFramework>net7.0</TargetFramework>
76
<Nullable>enable</Nullable>
87
</PropertyGroup>
98

src/tests/Regressions/coreclr/GitHub_49826/test49826.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<OutputType>Exe</OutputType>
44
<CLRTestPriority>1</CLRTestPriority>
55
<Nullable>enable</Nullable>
6-
<LangVersion>9.0</LangVersion>
76

87
<!-- ilasm round-trip testing test failure: https://github.com/dotnet/runtime/issues/49985 -->
98
<IlasmRoundTripIncompatible>true</IlasmRoundTripIncompatible>

src/tests/Regressions/coreclr/GitHub_49982/test49982.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<OutputType>Exe</OutputType>
44
<CLRTestPriority>1</CLRTestPriority>
55
<Nullable>enable</Nullable>
6-
<LangVersion>9.0</LangVersion>
76
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
87

98
<!-- This is an explicit crossgen test -->

0 commit comments

Comments
 (0)