<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>
// 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));
}
";
- /// <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>
<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 />
<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)
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
- <LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<EnablePreviewFeatures>True</EnablePreviewFeatures>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
- <LangVersion>10.0</LangVersion>
<NoWarn>$(NoWarn);CS3001</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>net6.0</TargetFramework>
- <LangVersion>latest</LangVersion>
+ <TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<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>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
<Nullable>enable</Nullable>
- <LangVersion>9.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- This is an explicit crossgen test -->