Skip to content

Commit e7e758d

Browse files
authored
Revert remove old runtimes (#2692)
* Revert remove old runtimes. * SuppressTfmSupportBuildWarnings in generated projects. Updated MultipleFrameworks tests. * Unrevert EnvRequirement.DotNetCore30Only * Fix test * PR feedback. * Some more reverts. * Fix github actions error.
1 parent de8fb91 commit e7e758d

File tree

31 files changed

+119
-77
lines changed

31 files changed

+119
-77
lines changed

.github/workflows/run-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: ./build.cmd in-tests-core -e
2828
# Upload Artifacts with Unique Name
2929
- name: Upload test results
30-
uses: actions/upload-artifact@v3
30+
uses: actions/upload-artifact@v4
3131
if: always()
3232
with:
3333
name: test-windows-core-trx-${{ github.run_id }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ The measured data can be exported to different formats (md, html, csv, xml, json
112112

113113
![](https://raw.githubusercontent.com/dotnet/BenchmarkDotNet/ec962b0bd6854c991d7a3ebd77037579165acb36/docs/images/v0.12.0/rplot.png)
114114

115-
*Supported runtimes:* .NET 5+, .NET Framework 4.6.1+, .NET Core 3.1+, Mono, NativeAOT
115+
*Supported runtimes:* .NET 5+, .NET Framework 4.6.1+, .NET Core 2.0+, Mono, NativeAOT
116116
*Supported languages:* C#, F#, Visual Basic
117117
*Supported OS:* Windows, Linux, macOS
118118
*Supported architectures:* x86, x64, ARM, ARM64, Wasm and LoongArch64
@@ -135,8 +135,8 @@ If you want to compare benchmarks with each other,
135135
mark one of the benchmarks as the [baseline](https://benchmarkdotnet.org/articles/features/baselines.html)
136136
via `[Benchmark(Baseline = true)]`: BenchmarkDotNet will compare it with all of the other benchmarks.
137137
If you want to compare performance in different environments, use [jobs](https://benchmarkdotnet.org/articles/configs/jobs.html).
138-
For example, you can run all the benchmarks on .NET Core 3.1 and Mono via
139-
`[SimpleJob(RuntimeMoniker.NetCoreApp31)]` and `[SimpleJob(RuntimeMoniker.Mono)]`.
138+
For example, you can run all the benchmarks on .NET 8.0 and Mono via
139+
`[SimpleJob(RuntimeMoniker.Net80)]` and `[SimpleJob(RuntimeMoniker.Mono)]`.
140140

141141
If you don't like attributes, you can call most of the APIs via the fluent style and write code like this:
142142

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2424

2525
<Nullable>annotations</Nullable>
26-
<!-- Lets supress the "System.Collections.Immutable 8.0.0 doesn't support netcoreapp3.1" warning -->
26+
<!-- Suppress warning for nuget package used in old (unsupported) tfm. -->
2727
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
2828
</PropertyGroup>
2929

docs/articles/faq.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ See also: [BenchmarkDotNet#237](https://github.com/dotnet/BenchmarkDotNet/issues
1313

1414
* **Q** Why can't I install BenchmarkDotNet in a new .NET Core Console App in Visual Studio 2017?
1515

16-
**A** BenchmarkDotNet supports only netcoreapp3.1+.
16+
**A** BenchmarkDotNet supports only netcoreapp2.0+.
1717
Some old Visual Studio 2017 can create a new application which targets netcoreapp1.0.
18-
You should upgrade it up to 3.1.
18+
You should upgrade it up to 2.0.
1919
If you want to target netcoreapp1.0 in your main assembly, it's recommended to create a separated project for benchmarks.
2020

2121
* **Q** I created a new .NET Core Console App in Visual Studio 2017. Now I want to run my code on CoreCLR, full .NET Framework, and Mono. How can I do it?
2222

2323
**A** Use the following lines in your `.csproj` file:
2424

2525
```xml
26-
<TargetFrameworks>netcoreapp3.1;net46</TargetFrameworks>
26+
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
2727
<PlatformTarget>AnyCPU</PlatformTarget>
2828
```
2929

@@ -33,7 +33,7 @@ If you want to target netcoreapp1.0 in your main assembly, it's recommended to c
3333
[CoreJob, ClrJob, MonoJob]
3434
```
3535

36-
* **Q** My source code targets old versions of .NET Framework or .NET Core, but BenchmarkDotNet requires `net461` and `netcoreapp3.1`. How can I run benchmarks in this case?
36+
* **Q** My source code targets old versions of .NET Framework or .NET Core, but BenchmarkDotNet requires `net461` and `netcoreapp2.0`. How can I run benchmarks in this case?
3737

3838
**A** It's a good practice to introduce an additional console application (e.g. `MyAwesomeLibrary.Benchmarks`) which will depend on your code and BenchmarkDotNet.
3939
Due to the fact that users usually run benchmarks in a develop environment and don't distribute benchmarks for users, it shouldn't be a problem.

docs/articles/guides/troubleshooting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ How do you know that BenchmarkDotNet has failed to build the project? BDN is goi
1111
// ***** BenchmarkRunner: Start *****
1212
// ***** Found 1 benchmark(s) in total *****
1313
// ***** Building 1 exe(s) in Parallel: Start *****
14-
// start dotnet restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\net8.0\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4
14+
// start dotnet restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\netcoreapp2.1\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4
1515
// command took 0.51s and exited with 1
1616
// ***** Done, took 00:00:00 (0.66 sec) *****
1717
// Found 1 benchmarks:
@@ -20,10 +20,10 @@ How do you know that BenchmarkDotNet has failed to build the project? BDN is goi
2020
// Build Error: Standard output:
2121
2222
Standard error:
23-
C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\net8.0\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4\BenchmarkDotNet.Autogenerated.csproj(36,1): error MSB4025: The project file could not be loaded. Unexpected end of file while parsing Comment has occurred. Line 36, position 1.
23+
C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\netcoreapp2.1\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4\BenchmarkDotNet.Autogenerated.csproj(36,1): error MSB4025: The project file could not be loaded. Unexpected end of file while parsing Comment has occurred. Line 36, position 1.
2424
2525
// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
26-
// It can be found in C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\net8.0\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4
26+
// It can be found in C:\Projects\BenchmarkDotNet\samples\BenchmarkDotNet.Samples\bin\Release\netcoreapp2.1\c6045772-d3c7-4dbe-ab37-4aca6dcb6ec4
2727
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html
2828
```
2929

docs/articles/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name: Overview
1010
Create new console application and install the [BenchmarkDotNet](https://www.nuget.org/packages/BenchmarkDotNet/) NuGet package. We support:
1111

1212
* *Projects:* classic and modern with PackageReferences
13-
* *Runtimes:* Full .NET Framework (4.6+), .NET Core (3.1+), Mono, NativeAOT
13+
* *Runtimes:* Full .NET Framework (4.6+), .NET Core (2.0+), Mono, NativeAOT
1414
* *OS:* Windows, Linux, MacOS
1515
* *Languages:* C#, F#, VB
1616

src/BenchmarkDotNet.Annotations/Jobs/RuntimeMoniker.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,22 @@ public enum RuntimeMoniker
5757
/// <summary>
5858
/// .NET Core 2.0
5959
/// </summary>
60-
[Obsolete("This runtime is no longer supported. Use a newer runtime or use BenchmarkDotNet v0.14.X or older.", true)]
61-
// Assigning explicit values so we can check for them without the compiler erroring.
62-
NetCoreApp20 = 10,
60+
NetCoreApp20,
6361

6462
/// <summary>
6563
/// .NET Core 2.1
6664
/// </summary>
67-
[Obsolete("This runtime is no longer supported. Use a newer runtime or use BenchmarkDotNet v0.14.X or older.", true)]
68-
NetCoreApp21 = 11,
65+
NetCoreApp21,
6966

7067
/// <summary>
7168
/// .NET Core 2.2
7269
/// </summary>
73-
[Obsolete("This runtime is no longer supported. Use a newer runtime or use BenchmarkDotNet v0.14.X or older.", true)]
74-
NetCoreApp22 = 12,
70+
NetCoreApp22,
7571

7672
/// <summary>
7773
/// .NET Core 3.0
7874
/// </summary>
79-
[Obsolete("This runtime is no longer supported. Use a newer runtime or use BenchmarkDotNet v0.14.X or older.", true)]
80-
NetCoreApp30 = 13,
75+
NetCoreApp30,
8176

8277
/// <summary>
8378
/// .NET Core 3.1

src/BenchmarkDotNet.Diagnostics.dotMemory/DotMemoryDiagnoser.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
112112
case RuntimeMoniker.NetCoreApp50:
113113
#pragma warning restore CS0618 // Type or member is obsolete
114114
return false;
115+
case RuntimeMoniker.NetCoreApp20:
116+
case RuntimeMoniker.NetCoreApp21:
117+
case RuntimeMoniker.NetCoreApp22:
118+
return OsDetector.IsWindows();
119+
case RuntimeMoniker.NetCoreApp30:
115120
case RuntimeMoniker.NetCoreApp31:
116121
return OsDetector.IsWindows() || OsDetector.IsLinux();
117122
default:

src/BenchmarkDotNet.Diagnostics.dotTrace/DotTraceDiagnoser.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ internal override bool IsSupported(RuntimeMoniker runtimeMoniker)
115115
case RuntimeMoniker.NetCoreApp50:
116116
#pragma warning restore CS0618 // Type or member is obsolete
117117
return false;
118+
case RuntimeMoniker.NetCoreApp20:
119+
case RuntimeMoniker.NetCoreApp21:
120+
case RuntimeMoniker.NetCoreApp22:
121+
return OsDetector.IsWindows();
122+
case RuntimeMoniker.NetCoreApp30:
118123
case RuntimeMoniker.NetCoreApp31:
119124
return OsDetector.IsWindows() || OsDetector.IsLinux();
120125
default:

src/BenchmarkDotNet/BenchmarkDotNet.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.8" PrivateAssets="contentfiles;analyzers" />
2424
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
2525
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
26-
<!-- Do not update these packages, or else netcoreapp3.1 may no longer work -->
2726
<PackageReference Include="System.Management" Version="6.0.0" />
2827
</ItemGroup>
2928
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">

0 commit comments

Comments
 (0)