Skip to content

Commit 90c82bb

Browse files
Deprecate methods (#2204)
1 parent ccbaf08 commit 90c82bb

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/BenchmarkDotNet/Running/BenchmarkRunnerDirty.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,18 @@ public static Summary[] Run(BenchmarkRunInfo[] benchmarkRunInfos)
6666
return RunWithExceptionHandling(() => RunWithDirtyAssemblyResolveHelper(benchmarkRunInfos));
6767
}
6868

69-
/// <summary>
70-
/// Supported only on Full .NET Framework. Not recommended.
71-
/// </summary>
7269
[PublicAPI]
7370
[EditorBrowsable(EditorBrowsableState.Never)]
71+
[Obsolete("This method will be removed soon as it is not supported in .NET Core")]
7472
public static Summary RunUrl(string url, IConfig config = null)
7573
{
7674
using (DirtyAssemblyResolveHelper.Create())
7775
return RunWithExceptionHandling(() => RunUrlWithDirtyAssemblyResolveHelper(url, config));
7876
}
7977

80-
/// <summary>
81-
/// Supported only on Full .NET Framework. Not recommended.
82-
/// </summary>
8378
[PublicAPI]
8479
[EditorBrowsable(EditorBrowsableState.Never)]
80+
[Obsolete("This method will be removed soon as it is not supported in .NET Core")]
8581
public static Summary RunSource(string source, IConfig config = null)
8682
{
8783
using (DirtyAssemblyResolveHelper.Create())
@@ -115,6 +111,7 @@ private static Summary[] RunWithDirtyAssemblyResolveHelper(Type[] types, IConfig
115111
private static Summary[] RunWithDirtyAssemblyResolveHelper(BenchmarkRunInfo[] benchmarkRunInfos)
116112
=> BenchmarkRunnerClean.Run(benchmarkRunInfos);
117113

114+
#pragma warning disable CS0618 // Use of obsolete symbol
118115
[MethodImpl(MethodImplOptions.NoInlining)]
119116
private static Summary RunUrlWithDirtyAssemblyResolveHelper(string url, IConfig config = null)
120117
=> RuntimeInformation.IsFullFramework
@@ -126,6 +123,7 @@ private static Summary RunSourceWithDirtyAssemblyResolveHelper(string source, IC
126123
=> RuntimeInformation.IsFullFramework
127124
? BenchmarkRunnerClean.Run(BenchmarkConverter.SourceToBenchmarks(source, config)).Single()
128125
: throw new InvalidBenchmarkDeclarationException("Supported only on Full .NET Framework");
126+
#pragma warning restore CS0618 // Use of obsolete symbol
129127

130128
private static Summary RunWithExceptionHandling(Func<Summary> run)
131129
{

src/BenchmarkDotNet/Running/ClassicBenchmarkConverter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.CodeDom.Compiler;
33
using System.Collections.Generic;
4+
using System.ComponentModel;
45
using System.IO;
56
using System.Linq;
67
#if NET6_0_OR_GREATER
@@ -22,6 +23,8 @@ public static partial class BenchmarkConverter
2223
private static readonly HttpClient Client = new HttpClient();
2324
#endif
2425

26+
[EditorBrowsable(EditorBrowsableState.Never)]
27+
[Obsolete("This method will be removed soon as it is not supported in .NET Core")]
2528
public static BenchmarkRunInfo[] UrlToBenchmarks(string url, IConfig config = null)
2629
{
2730
if (!RuntimeInformation.IsFullFramework)
@@ -65,6 +68,8 @@ public static BenchmarkRunInfo[] UrlToBenchmarks(string url, IConfig config = nu
6568
return SourceToBenchmarks(benchmarkContent, config);
6669
}
6770

71+
[EditorBrowsable(EditorBrowsableState.Never)]
72+
[Obsolete("This method will be removed soon as it is not supported in .NET Core")]
6873
public static BenchmarkRunInfo[] SourceToBenchmarks(string source, IConfig config = null)
6974
{
7075
if (!RuntimeInformation.IsFullFramework)

0 commit comments

Comments
 (0)