Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove explicit LangVersion from a few projects #75806

Merged
merged 4 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions src/coreclr/tools/dotnet-pgo/dotnet-pgo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
<PackageReleaseNotes>$(Description)</PackageReleaseNotes>
<RootNamespace>Microsoft.Diagnostics.Tools.Pgo</RootNamespace>
<RollForward>Major</RollForward>
<!-- TODO Remove the language version limitation when the reference assemblies
are updated with the new scoped keyword. -->
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 5 additions & 6 deletions src/libraries/Common/tests/StaticTestGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ public static void Main(string[] args)

// Write out the associated .csproj
string csprojPath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(testAssemblyPath) + "-runner.csproj");
Version version = Environment.Version;
File.WriteAllText(
csprojPath,
CSProjTemplate
GetCsprojTemplate($"net{version.Major}.{version.Minor}")
.Replace("#HelperAssemblyLocation#", Path.GetDirectoryName(testAssemblyPath) + Path.DirectorySeparatorChar)
.Replace("#TestAssembly#", Path.GetFullPath(testAssemblyPath))
.Replace("#TestAssemblyLocation#", testAssemblyPath));
Expand Down Expand Up @@ -1127,13 +1128,11 @@ public void WriteLine(string format, params object[] args)
}
";

/// <summary>The template for the .csproj.</summary>
private const string CSProjTemplate =
@"<Project Sdk=""Microsoft.NET.Sdk"">
private string GetCsprojTemplate(string targetFramework) =>
$@"<Project Sdk=""Microsoft.NET.Sdk"">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
<TargetFramework>{targetFramework}</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>IDE0049</NoWarn> <!-- names can be simplified -->
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
<LangVersion>preview</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<NoWarn>$(NoWarn);SA1205;CA1845</NoWarn>
<EnableTrimAnalyzer Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">false</EnableTrimAnalyzer>
<IsPackable>true</IsPackable>
<!-- Lifetime rules introduced in C# 11 impact scenarios in net6 framework -->
<LangVersion Condition="'$(TargetFramework)' == 'net6.0'">10</LangVersion>
<EnableAOTAnalyzer>true</EnableAOTAnalyzer>
<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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<NoWarn>$(NoWarn);CS3001</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>

<!-- ilasm round-trip testing test failure: https://github.com/dotnet/runtime/issues/49985 -->
<IlasmRoundTripIncompatible>true</IlasmRoundTripIncompatible>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<Nullable>enable</Nullable>
<LangVersion>9.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- This is an explicit crossgen test -->
Expand Down