Skip to content

Commit 20c6f95

Browse files
authored
add .net 9 rc1 (#47)
* add .net 9 rc1 * fix using
1 parent 94a2aa9 commit 20c6f95

File tree

14 files changed

+47
-53
lines changed

14 files changed

+47
-53
lines changed

Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2525
</PropertyGroup>
2626

27+
<PropertyGroup Label="Project Defaults">
28+
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
29+
</PropertyGroup>
30+
2731
<PropertyGroup Label="C#">
2832
<LangVersion>12.0</LangVersion>
2933
<Nullable>enable</Nullable>

Directory.Packages.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
<PackageVersion Include="Ng.UserAgentService" Version="3.0.0" />
1616
</ItemGroup>
1717
<ItemGroup Label="Tests / Performance">
18-
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
19-
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
18+
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
19+
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
2020
<PackageVersion Include="NSubstitute" Version="5.1.0" />
2121
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.2" />
22-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
23-
<PackageVersion Include="xunit" Version="2.8.0" />
24-
<PackageVersion Include="xunit.runner.console" Version="2.8.0">
22+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
23+
<PackageVersion Include="xunit" Version="2.9.0" />
24+
<PackageVersion Include="xunit.runner.console" Version="2.9.0">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageVersion>
28-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0">
28+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2">
2929
<PrivateAssets>all</PrivateAssets>
3030
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3131
</PackageVersion>
@@ -35,15 +35,15 @@
3535
</PackageVersion>
3636
</ItemGroup>
3737
<ItemGroup Label="Roslyn">
38-
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.2">
38+
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4">
3939
<PrivateAssets>all</PrivateAssets>
4040
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4141
</PackageVersion>
42-
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.2">
42+
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.4">
4343
<PrivateAssets>all</PrivateAssets>
4444
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4545
</PackageVersion>
46-
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.2">
46+
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.4">
4747
<PrivateAssets>all</PrivateAssets>
4848
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4949
</PackageVersion>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.100"
3+
"version": "9.0.100-rc.1.24452.12"
44
}
55
}
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
// Copyright © myCSharp.de - all rights reserved
22

3-
using System.Collections.Generic;
4-
using System.Linq;
53
using BenchmarkDotNet.Attributes;
4+
using BenchmarkDotNet.Jobs;
65

76
#if OS_WIN
87
using BenchmarkDotNet.Diagnostics.Windows.Configs;
98
#endif
109

11-
namespace MyCSharp.HttpUserAgentParser.Benchmarks
12-
{
13-
[MemoryDiagnoser]
10+
namespace MyCSharp.HttpUserAgentParser.Benchmarks;
11+
12+
[MemoryDiagnoser]
13+
[SimpleJob(RuntimeMoniker.Net80)]
14+
[SimpleJob(RuntimeMoniker.Net90)]
1415
#if OS_WIN
15-
[EtwProfiler] // needs admin-rights
16+
[EtwProfiler] // needs admin-rights
1617
#endif
17-
public class HttpUserAgentParserBenchmarks
18+
public class HttpUserAgentParserBenchmarks
19+
{
20+
private string[] _testUserAgentMix;
21+
private HttpUserAgentInformation[] _results;
22+
23+
[GlobalSetup]
24+
public void GlobalSetup()
1825
{
19-
private string[] _testUserAgentMix;
20-
private HttpUserAgentInformation[] _results;
26+
_testUserAgentMix = GetTestUserAgents().ToArray();
27+
_results = new HttpUserAgentInformation[_testUserAgentMix.Length];
28+
}
2129

22-
[GlobalSetup]
23-
public void GlobalSetup()
24-
{
25-
_testUserAgentMix = GetTestUserAgents().ToArray();
26-
_results = new HttpUserAgentInformation[_testUserAgentMix.Length];
27-
}
30+
private static IEnumerable<string> GetTestUserAgents()
31+
{
32+
yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36";
33+
yield return "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)";
34+
yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0";
35+
yield return "yeah I'm unknown user agent, just to bring some fun to the mix";
36+
}
2837

29-
private static IEnumerable<string> GetTestUserAgents()
30-
{
31-
yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36";
32-
yield return "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)";
33-
yield return "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0";
34-
yield return "yeah I'm unknown user agent, just to bring some fun to the mix";
35-
}
38+
[Benchmark]
39+
public void Parse()
40+
{
41+
string[] testUserAgentMix = _testUserAgentMix;
42+
HttpUserAgentInformation[] results = _results;
3643

37-
[Benchmark]
38-
public void Parse()
44+
for (int i = 0; i < testUserAgentMix.Length; ++i)
3945
{
40-
string[] testUserAgentMix = _testUserAgentMix;
41-
HttpUserAgentInformation[] results = _results;
42-
43-
for (int i = 0; i < testUserAgentMix.Length; ++i)
44-
{
45-
results[i] = HttpUserAgentParser.Parse(testUserAgentMix[i]);
46-
}
46+
results[i] = HttpUserAgentParser.Parse(testUserAgentMix[i]);
4747
}
4848
}
4949
}

perf/MyCSharp.HttpUserAgentParser.Benchmarks/LibraryComparison/LibraryComparisonBenchmarks.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright © myCSharp.de - all rights reserved
22

3-
using System.Collections.Generic;
43
using BenchmarkDotNet.Attributes;
54
using BenchmarkDotNet.Columns;
65
using BenchmarkDotNet.Configs;

perf/MyCSharp.HttpUserAgentParser.Benchmarks/MyCSharp.HttpUserAgentParser.Benchmarks.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
65
<Nullable>disable</Nullable>
76
</PropertyGroup>
87

perf/MyCSharp.HttpUserAgentParser.Benchmarks/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
ManualConfig config = ManualConfig.Create(DefaultConfig.Instance)
1010
.WithOptions(ConfigOptions.DisableOptimizationsValidator);
1111

12+
13+
// dotnet run -c Release --framework net80 net90 --runtimes net90
1214
BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args, config);

src/MyCSharp.HttpUserAgentParser.AspNetCore/MyCSharp.HttpUserAgentParser.AspNetCore.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<Product>HTTP User Agent Parser Extensions for ASP.NET Core</Product>
55
<Description>HTTP User Agent Parser Extensions for ASP.NET Core</Description>
6-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
76
</PropertyGroup>
87

98
<PropertyGroup Label="Package">

src/MyCSharp.HttpUserAgentParser.MemoryCache/MyCSharp.HttpUserAgentParser.MemoryCache.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<Product>HTTP User Agent Parser Extensions for IMemoryCache</Product>
55
<Description>HTTP User Agent Parser Extensions for IMemoryCache</Description>
6-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
76
</PropertyGroup>
87

98
<PropertyGroup Label="Package">

src/MyCSharp.HttpUserAgentParser/MyCSharp.HttpUserAgentParser.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<Product>HTTP User Agent Parser</Product>
55
<Description>Parses user agents for Browser, Platform and Bots.</Description>
6-
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
76
</PropertyGroup>
87

98
<PropertyGroup Label="Package">

0 commit comments

Comments
 (0)