Skip to content

Commit 811c12a

Browse files
Update to .NET 10 (#858)
* Update to .NET 10 Update to .NET 10 with .NET SDK version 10.0.100-preview.3.25201.16. Co-Authored-By: costellobot <102549341+costellobot@users.noreply.github.com> * Update .NET SDK to 10.0.100-preview.4.25258.110 (#920) * Update .NET SDK Update .NET SDK to version 10.0.100-preview.4.25258.110. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-version: 10.0.100-preview.4.25258.110 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Bump .NET NuGet packages Bumps .NET dependencies to their latest versions for the .NET 10.0.100-preview.4.25258.110 SDK. Bumps Microsoft.AspNetCore.Mvc.Testing from 10.0.0-preview.3.25172.1 to 10.0.0-preview.4.25258.110. Bumps Microsoft.Extensions.Logging from 10.0.0-preview.3.25171.5 to 10.0.0-preview.4.25258.110. --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.Testing dependency-version: 10.0.0-preview.4.25258.110 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.0-preview.4.25258.110 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Update .NET SDK to 10.0.100-preview.5.25277.114 (#939) * Update .NET SDK Update .NET SDK to version 10.0.100-preview.5.25277.114. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-version: 10.0.100-preview.5.25277.114 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Bump .NET NuGet packages Bumps .NET dependencies to their latest versions for the .NET 10.0.100-preview.5.25277.114 SDK. Bumps Microsoft.AspNetCore.Mvc.Testing from 10.0.0-preview.4.25258.110 to 10.0.0-preview.5.25277.114. Bumps Microsoft.Extensions.Logging from 10.0.0-preview.4.25258.110 to 10.0.0-preview.5.25277.114. --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.Testing dependency-version: 10.0.0-preview.5.25277.114 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.0-preview.5.25277.114 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Updates for rebase Fix-up package references. * Reorder TFMs Put `net10.0` first. * Update to .NET 10 preview 6 Update to preview 6 of .NET 10. * Remove suppression Now configured in the project file. * Update .NET SDK to 10.0.100-preview.7.25380.108 (#992) * Update .NET SDK Update .NET SDK to version 10.0.100-preview.7.25380.108. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-version: 10.0.100-preview.7.25380.108 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Bump .NET NuGet packages Bumps .NET dependencies to their latest versions for the .NET 10.0.100-preview.7.25380.108 SDK. Bumps Microsoft.AspNetCore.Mvc.Testing from 10.0.0-preview.6.25358.103 to 10.0.0-preview.7.25380.108. Bumps Microsoft.Extensions.Logging from 10.0.0-preview.6.25358.103 to 10.0.0-preview.7.25380.108. --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.Testing dependency-version: 10.0.0-preview.7.25380.108 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.0-preview.7.25380.108 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Update NuGet packages Update NuGet packages for .NET 10 preview 7. * Update .NET SDK (#1015) Update .NET SDK to version 10.0.100-rc.1.25451.107. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-version: 10.0.100-rc.1.25451.107 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Update NuGet packages Update NuGet packages for .NET 10 RC1. * Simplify parameter validation Use C# 14 extension-everything to polyfill `ArgumentNullException.ThrowIfNull()`. * Update .NET SDK to 10.0.100-rc.2.25502.107 (#1054) * Update .NET SDK Update .NET SDK to version 10.0.100-rc.2.25502.107. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-version: 10.0.100-rc.2.25502.107 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Bump .NET NuGet packages Bumps .NET dependencies to their latest versions for the .NET 10.0.100-rc.2.25502.107 SDK. Bumps Microsoft.AspNetCore.Mvc.Testing from 10.0.0-rc.1.25451.107 to 10.0.0-rc.2.25502.107. Bumps Microsoft.Extensions.Logging from 10.0.0-rc.1.25451.107 to 10.0.0-rc.2.25502.107. --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Mvc.Testing dependency-version: 10.0.0-rc.2.25502.107 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.Extensions.Logging dependency-version: 10.0.0-rc.2.25502.107 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> * Fix package references Updates for .NET 10 RC2. --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> Co-authored-by: Martin Costello <martin@martincostello.com> * Update to .NET 10 GA (#1076) - Update to the stable release of .NET 10. - Bump version to 0.7.0. * Remove NU5104 suppression No longer needed. --------- Signed-off-by: costellobot <102549341+costellobot@users.noreply.github.com> Co-authored-by: martincostello <martin@martincostello.com>
1 parent adb14e4 commit 811c12a

17 files changed

+67
-340
lines changed

.vsconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"components": [
44
"Microsoft.VisualStudio.Component.CoreEditor",
55
"Microsoft.VisualStudio.Workload.CoreEditor",
6-
"Microsoft.NetCore.Component.Runtime.9.0",
6+
"Microsoft.NetCore.Component.Runtime.10.0",
77
"Microsoft.NetCore.Component.SDK",
88
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
99
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices"

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<PackageTags>xunit;logging</PackageTags>
88
<UseArtifactsOutput>true</UseArtifactsOutput>
99
<UseDefaultAssemblyOriginatorKeyFile>true</UseDefaultAssemblyOriginatorKeyFile>
10-
<AssemblyVersion>0.6.0.0</AssemblyVersion>
10+
<AssemblyVersion>0.7.0.0</AssemblyVersion>
1111
<PackageValidationBaselineVersion>0.6.0</PackageValidationBaselineVersion>
12-
<VersionPrefix>0.6.1</VersionPrefix>
12+
<VersionPrefix>0.7.0</VersionPrefix>
1313
</PropertyGroup>
1414
<PropertyGroup Condition=" '$(EnableReferenceTrimmer)' != 'false' and '$(GenerateDocumentationFile)' != 'true' ">
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
99
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
1010
<PackageVersion Include="JunitXml.TestLogger" Version="7.0.2" />
11-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.10" />
11+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0" />
1212
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
13-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
13+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
1414
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1515
<PackageVersion Include="NSubstitute" Version="5.3.0" />
1616
<PackageVersion Include="ReportGenerator" Version="5.4.18" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.306",
3+
"version": "10.0.100",
44
"allowPrerelease": false,
55
"rollForward": "latestMajor",
66
"paths": [ ".dotnet", "$host$" ],

src/Logging.XUnit.v3/MartinCostello.Logging.XUnit.v3.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<OutputType>Library</OutputType>
1010
<PackageId>MartinCostello.Logging.XUnit.v3</PackageId>
1111
<RootNamespace>MartinCostello.Logging.XUnit</RootNamespace>
12-
<TargetFrameworks>net8.0;net472</TargetFrameworks>
12+
<TargetFrameworks>net10.0;net8.0;net472</TargetFrameworks>
1313
<Title>xunit v3 Logging Extensions</Title>
1414
</PropertyGroup>
1515
<ItemGroup>
@@ -19,6 +19,9 @@
1919
<PackageReference Include="Microsoft.Extensions.Logging" VersionOverride="[8.0.1,)" />
2020
<PackageReference Include="xunit.v3.extensibility.core" VersionOverride="[2.0.1,)" />
2121
</ItemGroup>
22+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
23+
<PackageReference Update="Microsoft.Extensions.Logging" VersionOverride="[10.0.0,)" />
24+
</ItemGroup>
2225
<ItemGroup>
2326
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
2427
</ItemGroup>

src/Logging.XUnit/MartinCostello.Logging.XUnit.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<OutputType>Library</OutputType>
99
<PackageId>MartinCostello.Logging.XUnit</PackageId>
1010
<RootNamespace>MartinCostello.Logging.XUnit</RootNamespace>
11-
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
11+
<TargetFrameworks>net10.0;net8.0;netstandard2.0</TargetFrameworks>
1212
<Title>xunit Logging Extensions</Title>
1313
</PropertyGroup>
1414
<ItemGroup>
@@ -19,6 +19,9 @@
1919
<PackageReference Include="xunit.abstractions" VersionOverride="[2.0.3,)" />
2020
<PackageReference Include="xunit.extensibility.execution" VersionOverride="[2.6.6,)" />
2121
</ItemGroup>
22+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
23+
<PackageReference Update="Microsoft.Extensions.Logging" VersionOverride="[10.0.0,)" />
24+
</ItemGroup>
2225
<ItemGroup>
2326
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
2427
</ItemGroup>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Martin Costello, 2018. All rights reserved.
2+
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
3+
4+
#if NETFRAMEWORK || NETSTANDARD
5+
using System.Runtime.CompilerServices;
6+
7+
#pragma warning disable IDE0130
8+
namespace System;
9+
10+
/// <summary>
11+
/// Extension methods for <see cref="ArgumentNullException"/>.
12+
/// </summary>
13+
internal static class ArgumentNullExceptionExtensions
14+
{
15+
extension(ArgumentNullException)
16+
{
17+
/// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null.</summary>
18+
/// <param name="argument">The reference type argument to validate as non-null.</param>
19+
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
20+
public static void ThrowIfNull(object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
21+
{
22+
if (argument is null)
23+
{
24+
throw new ArgumentNullException(paramName);
25+
}
26+
}
27+
}
28+
}
29+
#endif
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Martin Costello, 2018. All rights reserved.
2+
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
3+
4+
#if NETFRAMEWORK || NETSTANDARD
5+
#pragma warning disable IDE0130
6+
namespace System.Runtime.CompilerServices;
7+
8+
/// <summary>
9+
/// Indicates that a parameter captures the expression passed for another parameter as a string.
10+
/// </summary>
11+
/// <param name="parameterName">The name of the parameter whose expression should be captured as a string.</param>
12+
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
13+
internal sealed class CallerArgumentExpressionAttribute(string parameterName) : Attribute
14+
{
15+
/// <summary>
16+
/// Gets the name of the parameter whose expression should be captured as a string.
17+
/// </summary>
18+
public string ParameterName { get; } = parameterName;
19+
}
20+
#endif

src/Shared/IMessageSinkExtensions.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ public static class IMessageSinkExtensions
2929
/// </exception>
3030
public static ILoggerFactory ToLoggerFactory(this IMessageSink messageSink)
3131
{
32-
#if NET
3332
ArgumentNullException.ThrowIfNull(messageSink);
34-
#else
35-
if (messageSink == null)
36-
{
37-
throw new ArgumentNullException(nameof(messageSink));
38-
}
39-
#endif
4033

4134
return new LoggerFactory().AddXUnit(messageSink);
4235
}

src/Shared/ITestOutputHelperExtensions.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ public static class ITestOutputHelperExtensions
2929
/// </exception>
3030
public static ILoggerFactory ToLoggerFactory(this ITestOutputHelper outputHelper)
3131
{
32-
#if NET
3332
ArgumentNullException.ThrowIfNull(outputHelper);
34-
#else
35-
if (outputHelper == null)
36-
{
37-
throw new ArgumentNullException(nameof(outputHelper));
38-
}
39-
#endif
4033

4134
return new LoggerFactory().AddXUnit(outputHelper);
4235
}

0 commit comments

Comments
 (0)