Skip to content

Commit 1b47e7d

Browse files
authored
Upgrade to .NET 8 (#1375)
As we're doing breaking changes in v6, it might be worth upgrading to the current [Long Term Support](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core) version of dotnet. This enables us to use C# 12 features and remove a bunch of conditional compilation (net 5328 deletions)
1 parent 6ab5f21 commit 1b47e7d

File tree

13 files changed

+14
-40
lines changed

13 files changed

+14
-40
lines changed

CodeGen/CodeGen.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>
88
<!-- Allow compile with various nullability warnings until fixed. -->

CodeGen/Exceptions/UnitsNetCodeGenException.cs

-9
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@
22
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
33

44
using System;
5-
using System.Runtime.Serialization;
65

76
namespace CodeGen.Exceptions
87
{
98
internal class UnitsNetCodeGenException : Exception
109
{
11-
public UnitsNetCodeGenException()
12-
{
13-
}
14-
15-
protected UnitsNetCodeGenException(SerializationInfo info, StreamingContext context) : base(info, context)
16-
{
17-
}
18-
1910
public UnitsNetCodeGenException(string message) : base(message)
2011
{
2112
}

PerfTests/PerfTest_Startup/PerfTest_Startup.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<RootNamespace>perftest</RootNamespace>

PerfTests/PerfTest_Startup_v4_144_0/PerfTest_Startup_v4_144_0.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<RootNamespace>perftest_before</RootNamespace>

PerfTests/PerfTest_Startup_v4_72_0/PerfTest_Startup_v4_72_0.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<RootNamespace>perftest_before</RootNamespace>

UnitsNet.Benchmark/Scripts/json-export-all-runtimes.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ SET projectdir="%scriptdir%..\.."
44
SET exportdir="%projectdir%\Artifacts\Benchmark"
55
:: this fails on the build server (also tested with the nightly benchmark.net package: 0.12.1.1533): possibly related to https://github.com/dotnet/BenchmarkDotNet/issues/1487
66
dotnet run --project "%projectdir%/UnitsNet.Benchmark" -c Release ^
7-
--framework net6.0 ^
8-
--runtimes net472 net48 netcoreapp2.1 netcoreapp3.1 net6.0 ^
7+
--framework net8.0 ^
8+
--runtimes net48 net8.0 ^
99
--artifacts=%exportdir% ^
1010
--exporters json ^
1111
--filter * ^
@@ -14,4 +14,4 @@ dotnet run --project "%projectdir%/UnitsNet.Benchmark" -c Release ^
1414
--join %1 %2 %3
1515

1616
:: this runs fine, however there is currently no way of displaying multiple-lines-per-chart: see https://github.com/rhysd/github-action-benchmark/issues/18
17-
:: dotnet run --project "%scriptdir%/UnitsNet.Benchmark" -c Release -f net6.0 --runtimes netcoreapp31 netcoreapp50 --filter ** --artifacts="%scriptdir%/Artifacts/Benchmark" --exporters json
17+
:: dotnet run --project "%scriptdir%/UnitsNet.Benchmark" -c Release -f net8.0 --runtimes net48 net8.0 --filter ** --artifacts="%scriptdir%/Artifacts/Benchmark" --exporters json

UnitsNet.Benchmark/Scripts/json-export-net5.bat

-17
This file was deleted.

UnitsNet.Benchmark/Scripts/r-plot-all-runtimes.bat

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ SET projectdir="%scriptdir%..\.."
44
SET exportdir="%projectdir%\Artifacts\Benchmark"
55
:: this fails on the build server (also tested with the nightly benchmark.net package: 0.12.1.1533): possibly related to https://github.com/dotnet/BenchmarkDotNet/issues/1487
66
dotnet run --project "%projectdir%\UnitsNet.Benchmark" -c Release ^
7-
--framework net5.0 ^
8-
--runtimes net472 net48 netcoreapp2.1 netcoreapp3.1 net6.0 ^
7+
--framework net8.0 ^
8+
--runtimes net48 net8.0 ^
99
--artifacts=%exportdir% ^
1010
--exporters rplot ^
1111
--filter * ^

UnitsNet.Benchmark/UnitsNet.Benchmark.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFrameworks>net6.0;net48</TargetFrameworks>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Version>4.0.0.0</Version>
66
<AssemblyVersion>4.0.0.0</AssemblyVersion>
77
<AssemblyTitle>UnitsNet.Benchmark</AssemblyTitle>

UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<RootNamespace>UnitsNet.NumberExtensions.Tests</RootNamespace>
66
<LangVersion>latest</LangVersion>
77
<Nullable>enable</Nullable>

UnitsNet.NumberExtensions/UnitsNet.NumberExtensions.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<LangVersion>latest</LangVersion>
2323
<Nullable>enable</Nullable>
2424
<RootNamespace>UnitsNet</RootNamespace>
25-
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
25+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
2626
</PropertyGroup>
2727

2828
<ItemGroup>

UnitsNet.Tests/UnitsNet.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net7.0;net48</TargetFrameworks>
4+
<TargetFramework>net8.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
<IsTestProject>true</IsTestProject>
77
<NoWarn>CS0618</NoWarn><!-- CS0618: 'member' is obsolete: 'text' (we often obsolete things before removal) -->

UnitsNet/UnitsNet.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<LangVersion>latest</LangVersion>
2525
<Nullable>enable</Nullable>
2626
<RootNamespace>UnitsNet</RootNamespace>
27-
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
27+
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
2828
</PropertyGroup>
2929

3030
<!-- SourceLink: https://github.com/dotnet/sourcelink -->

0 commit comments

Comments
 (0)