File tree Expand file tree Collapse file tree 6 files changed +29
-10
lines changed
samples/BenchmarkDotNet.Samples
src/BenchmarkDotNet.TestAdapter
BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks
BenchmarkDotNet.IntegrationTests Expand file tree Collapse file tree 6 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 16
16
</PropertyGroup >
17
17
<ItemGroup Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework' " >
18
18
<Reference Include =" System.Reflection" />
19
- <PackageReference Include =" System.Memory" Version =" 4.6.3" />
20
19
</ItemGroup >
21
20
<ItemGroup >
22
- <!-- Use v9.0.3 as baseline package for WithNuGet tests -->
23
- <PackageReference Include =" System.Collections.Immutable" Version =" 9.0.3 " />
21
+ <!-- Use v9.0.0 as baseline package for WithNuGet tests -->
22
+ <PackageReference Include =" System.Collections.Immutable" Version =" 9.0.0 " />
24
23
</ItemGroup >
25
24
<ItemGroup >
26
25
<PackageReference Include =" System.Drawing.Common" Version =" 9.0.5" />
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ public Config()
27
27
var baseJob = Job . MediumRun ;
28
28
29
29
string [ ] targetVersions = [
30
+ "9.0.0" ,
30
31
"9.0.3" ,
31
- "9.0.4" ,
32
32
"9.0.5" ,
33
33
] ;
34
34
35
35
foreach ( var version in targetVersions )
36
36
{
37
37
AddJob ( baseJob . WithNuGet ( "System.Collections.Immutable" , version )
38
- . WithId ( "v" + version ) ) ;
38
+ . WithId ( $ "v { version } " ) ) ;
39
39
}
40
40
}
41
41
}
Original file line number Diff line number Diff line change 3
3
using BenchmarkDotNet . Running ;
4
4
using BenchmarkDotNet . Toolchains ;
5
5
using System ;
6
- using System . Collections . Generic ;
6
+ using System . IO ;
7
7
using System . Linq ;
8
8
using System . Reflection ;
9
9
@@ -21,6 +21,28 @@ internal static class BenchmarkEnumerator
21
21
/// <returns>The benchmarks inside the assembly.</returns>
22
22
public static BenchmarkRunInfo [ ] GetBenchmarksFromAssemblyPath ( string assemblyPath )
23
23
{
24
+ #if NET462
25
+ // Temporary workaround for BenchmarkDotNet assembly loading issue that occurred under the following conditions:
26
+ // 1. Run BenchmarkDotNet.Samples project with following command.
27
+ // > dotnet test -c Release --list-tests --framework net462 -tl:off
28
+ // 2. When using `BenchmarkDotNet.TestAdapter` package and targeting .NET Framework.
29
+ AppDomain . CurrentDomain . AssemblyResolve += ( sender , eventArgs ) =>
30
+ {
31
+ if ( eventArgs . Name . StartsWith ( "BenchmarkDotNet, Version=" ) )
32
+ {
33
+ var baseDir = Path . GetDirectoryName ( assemblyPath ) ;
34
+ var path = Path . Combine ( baseDir , "BenchmarkDotNet.dll" ) ;
35
+ if ( File . Exists ( path ) )
36
+ {
37
+ return Assembly . LoadFrom ( path ) ;
38
+ }
39
+ }
40
+
41
+ // Fallback to default assembly resolver
42
+ return null ;
43
+ } ;
44
+ #endif
45
+
24
46
var assembly = Assembly . LoadFrom ( assemblyPath ) ;
25
47
26
48
var isDebugAssembly = assembly . IsJitOptimizationDisabled ( ) ?? false ;
Original file line number Diff line number Diff line change 30
30
</ItemGroup >
31
31
<ItemGroup >
32
32
<PackageReference Include =" Microsoft.NETCore.Platforms" Version =" 7.0.4" />
33
- <PackageReference Include =" System.Memory" Version =" [4.5.5]" />
34
33
</ItemGroup >
35
34
<ItemGroup >
36
35
<Content Include =" ..\BenchmarkDotNet.IntegrationTests.ManualRunning\xunit.runner.json" >
Original file line number Diff line number Diff line change 35
35
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.14.1" />
36
36
</ItemGroup >
37
37
<ItemGroup >
38
- <!-- Use v9.0.3 as baseline package for WithNuGet tests -->
39
- <PackageReference Include =" System.Collections.Immutable" Version =" [9.0.3 ]" />
38
+ <!-- Use v9.0.0 as baseline package for WithNuGet tests -->
39
+ <PackageReference Include =" System.Collections.Immutable" Version =" [9.0.0 ]" />
40
40
<PackageReference Include =" xunit" Version =" 2.9.3" />
41
41
<PackageReference Include =" xunit.runner.visualstudio" Version =" [2.8.2]" >
42
42
<PrivateAssets >all</PrivateAssets >
Original file line number Diff line number Diff line change 26
26
<ItemGroup Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework' " >
27
27
<ProjectReference Include =" ..\..\src\BenchmarkDotNet.Diagnostics.Windows\BenchmarkDotNet.Diagnostics.Windows.csproj" />
28
28
<PackageReference Include =" Microsoft.NETCore.Platforms" Version =" 7.0.4" />
29
- <PackageReference Include =" System.Memory" Version =" 4.6.3" />
30
29
<PackageReference Include =" System.Runtime.CompilerServices.Unsafe" Version =" 6.1.2" />
31
30
<Reference Include =" System.Runtime" />
32
31
<Reference Include =" System.Threading.Tasks" />
You can’t perform that action at this time.
0 commit comments