Skip to content

Commit eed763b

Browse files
committed
Add net6 TFM
1 parent 418a405 commit eed763b

File tree

16 files changed

+2721
-23
lines changed

16 files changed

+2721
-23
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
2.1.x
2929
3.1.x
3030
5.0.x
31+
6.0.x
3132
3233
- name: Run NUKE
3334
run: ./build.ps1

Build/Build.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Build : NukeBuild
4242
[Solution(GenerateProjects = true)]
4343
readonly Solution Solution;
4444

45-
[GitVersion(Framework = "net5.0")]
45+
[GitVersion(Framework = "net6.0")]
4646
readonly GitVersion GitVersion;
4747

4848
[PackageExecutable("nspec", "NSpecRunner.exe", Version = "3.1.0")]
@@ -159,7 +159,7 @@ class Build : NukeBuild
159159
.Executes(() =>
160160
{
161161
ReportGenerator(s => s
162-
.SetProcessToolPath(ToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net5.0"))
162+
.SetProcessToolPath(ToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
163163
.SetTargetDirectory(RootDirectory / "TestResults" / "reports")
164164
.AddReports(RootDirectory / "TestResults/**/coverage.cobertura.xml")
165165
.AddReportTypes("HtmlInline_AzurePipelines_Dark", "lcov")

Build/_build.csproj

Lines changed: 1 addition & 1 deletion
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-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<RootNamespace></RootNamespace>
66
<NoWarn>CS0649;CS0169</NoWarn>
77
<NukeRootDirectory>..\</NukeRootDirectory>

Src/FluentAssertions/Execution/AssertionScope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public sealed class AssertionScope : IAssertionScope
2323
private readonly FormattingOptions formattingOptions = AssertionOptions.FormattingOptions.Clone();
2424
private readonly IAssertionStrategy assertionStrategy;
2525
private readonly ContextDataItems contextData = new();
26+
private readonly StringBuilder tracing = new();
2627

2728
private Func<string> reason;
2829

@@ -32,7 +33,6 @@ public sealed class AssertionScope : IAssertionScope
3233
private Func<string> expectation;
3334
private string fallbackIdentifier = "object";
3435
private bool? succeeded;
35-
private readonly StringBuilder tracing = new();
3636

3737
private sealed class DeferredReportable
3838
{

Src/FluentAssertions/FluentAssertions.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<!-- To reduce build times, we only enable analyzers for the newest TFM -->
33
<PropertyGroup>
4-
<TargetFrameworks>net47;netcoreapp2.1;netcoreapp3.0;netstandard2.0;netstandard2.1</TargetFrameworks>
4+
<TargetFrameworks>net47;net6.0;netcoreapp2.1;netcoreapp3.0;netstandard2.0;netstandard2.1</TargetFrameworks>
55
<SignAssembly>True</SignAssembly>
66
<AssemblyOriginatorKeyFile>FluentAssertions.snk</AssemblyOriginatorKeyFile>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -31,7 +31,7 @@
3131
<Copyright>Copyright Dennis Doomen 2010-2020</Copyright>
3232
<LangVersion>9.0</LangVersion>
3333
</PropertyGroup>
34-
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
34+
<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0'">
3535
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
3636
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
3737
<RunAnalyzers>false</RunAnalyzers>
@@ -65,10 +65,10 @@
6565
<ItemGroup Condition=" !('$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'netstandard2.0') ">
6666
<Compile Remove="SystemExtensions.cs" />
6767
</ItemGroup>
68-
<ItemGroup Condition=" '$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.0' ">
68+
<ItemGroup Condition=" '$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.0' Or '$(TargetFramework)' == 'net6.0' ">
6969
<Compile Remove="Common/NullConfigurationStore.cs" />
7070
</ItemGroup>
71-
<ItemGroup Condition=" !('$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.0') ">
71+
<ItemGroup Condition=" !('$(TargetFramework)' == 'net47' Or '$(TargetFramework)' == 'netcoreapp2.1' Or '$(TargetFramework)' == 'netcoreapp3.0' Or '$(TargetFramework)' == 'net6.0') ">
7272
<Compile Remove="Common/AppSettingsConfigurationStore.cs" />
7373
<Compile Remove="Common/ConfigurationStoreExceptionInterceptor.cs" />
7474
</ItemGroup>
@@ -83,6 +83,9 @@
8383
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
8484
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
8585
</ItemGroup>
86+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
87+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
88+
</ItemGroup>
8689
<ItemGroup Condition="'$(TargetFramework)' == 'net47'">
8790
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.0" />
8891
<PackageReference Include="System.Net.Http" Version="4.3.4" />
@@ -91,7 +94,7 @@
9194
<Reference Include="System.Xml" />
9295
<Reference Include="System.Xml.Linq" />
9396
</ItemGroup>
94-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
97+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
9598
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3">
9699
<PrivateAssets>all</PrivateAssets>
97100
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Src/FluentAssertions/ObjectAssertionsExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ private static object CreateCloneUsingBinarySerializer(object subject)
147147
Binder = new SimpleBinder(subject.GetType())
148148
};
149149

150+
#pragma warning disable SYSLIB0011 // BinaryFormatter is obsoleted, GH-issue 1779 tracks the upcoming removal in .NET 8.0
150151
binaryFormatter.Serialize(stream, subject);
151152
stream.Position = 0;
152153
return binaryFormatter.Deserialize(stream);
154+
#pragma warning restore SYSLIB0011
153155
}
154156

155157
private class SimpleBinder : SerializationBinder

Src/FluentAssertions/StringSyntaxAttribute.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#if !NET7_0_OR_GREATER
33
// Licensed to the .NET Foundation under one or more agreements.
44
// The .NET Foundation licenses this file to you under the MIT license.
5-
65
#nullable enable
76

87
namespace System.Diagnostics.CodeAnalysis

Tests/Approval.Tests/ApiApproval.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class ApiApproval
1919
{
2020
[Theory]
2121
[InlineData("net47")]
22+
[InlineData("net6.0")]
2223
[InlineData("netstandard2.0")]
2324
[InlineData("netstandard2.1")]
2425
[InlineData("netcoreapp2.1")]

Tests/Approval.Tests/Approval.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)