Skip to content

Commit

Permalink
.NET9 RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rans4ckeR committed Sep 11, 2024
1 parent 2b66e37 commit ab11ad5
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 67 deletions.
27 changes: 18 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ csharp_style_var_for_built_in_types = false:warning
csharp_style_var_when_type_is_apparent = true:warning

# Expression-bodied members
csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_constructors = true:warning
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_lambdas = true:warning
csharp_style_expression_bodied_local_functions = true:warning
csharp_style_expression_bodied_methods = true:warning
csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_accessors = when_on_single_line:warning
csharp_style_expression_bodied_constructors = when_on_single_line:warning
csharp_style_expression_bodied_indexers = when_on_single_line:warning
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
csharp_style_expression_bodied_methods = when_on_single_line:warning
csharp_style_expression_bodied_operators = when_on_single_line:warning
csharp_style_expression_bodied_properties = when_on_single_line:warning

# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:warning
Expand Down Expand Up @@ -132,7 +132,7 @@ csharp_style_unused_value_assignment_preference = discard_variable:warning
csharp_style_unused_value_expression_statement_preference = discard_variable:warning

# 'using' directive preferences
csharp_using_directive_placement = inside_namespace:warning
csharp_using_directive_placement = outside_namespace:warning

# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:warning
Expand Down Expand Up @@ -405,6 +405,10 @@ dotnet_diagnostic.CA1008.severity = none
dotnet_diagnostic.API1002.severity = none
dotnet_diagnostic.API1003.severity = warning
dotnet_diagnostic.CA2263.severity = warning
csharp_prefer_static_anonymous_function = true:warning
csharp_prefer_system_threading_lock = true:warning
dotnet_diagnostic.IDE0330.severity = warning
dotnet_diagnostic.IDE0320.severity = warning

[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
Expand Down Expand Up @@ -619,6 +623,11 @@ dotnet_diagnostic.MSTEST0025.severity = warning
dotnet_diagnostic.MSTEST0017.severity = warning
dotnet_diagnostic.MSTEST0023.severity = warning
dotnet_diagnostic.MSTEST0024.severity = warning
dotnet_diagnostic.MSTEST0032.severity = warning
dotnet_diagnostic.MSTEST0029.severity = warning
dotnet_diagnostic.MSTEST0026.severity = warning
dotnet_diagnostic.MSTEST0030.severity = warning
dotnet_diagnostic.MSTEST0031.severity = warning

[*.vb]
dotnet_diagnostic.CA1047.severity = warning
6 changes: 3 additions & 3 deletions CnCNet/Net/PeerToPeer/PeerToPeerUtil.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace CnCNetServer;

using System.Buffers;
using System.Buffers;
using System.Collections.Concurrent;

namespace CnCNetServer;

internal sealed class PeerToPeerUtil(ILogger<PeerToPeerUtil> logger) : IAsyncDisposable
{
private const int CounterResetInterval = 60; // Reset counter every X s
Expand Down
6 changes: 3 additions & 3 deletions CnCNet/Net/Tunnel/Tunnel.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace CnCNetServer;

using System.Buffers;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

namespace CnCNetServer;

internal abstract class Tunnel(ILogger logger, IOptions<ServiceOptions> serviceOptions, IHttpClientFactory httpClientFactory)
: IAsyncDisposable
{
Expand Down
6 changes: 3 additions & 3 deletions CnCNet/Net/Tunnel/TunnelV2.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace CnCNetServer;

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;

namespace CnCNetServer;

internal sealed class TunnelV2(ILogger<TunnelV2> logger, IOptions<ServiceOptions> options, IHttpClientFactory httpClientFactory)
: Tunnel(logger, options, httpClientFactory)
{
Expand Down
6 changes: 3 additions & 3 deletions CnCNet/Net/Tunnel/TunnelV3.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace CnCNetServer;

using System.Security.Cryptography;
using System.Security.Cryptography;
using System.Text;

namespace CnCNetServer;

internal sealed class TunnelV3(ILogger<TunnelV3> logger, IOptions<ServiceOptions> options, IHttpClientFactory httpClientFactory)
: Tunnel(logger, options, httpClientFactory)
{
Expand Down
4 changes: 2 additions & 2 deletions CnCNetBackgroundService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace CnCNetServer;
using System.CommandLine.Parsing;

using System.CommandLine.Parsing;
namespace CnCNetServer;

internal sealed class CnCNetBackgroundService(
ILogger<CnCNetBackgroundService> logger,
Expand Down
6 changes: 3 additions & 3 deletions Infrastructure/ExceptionMessageBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace CnCNetServer;

using System.ComponentModel;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;

namespace CnCNetServer;

internal static class ExceptionMessageBuilder
{
public static string GetDetailedExceptionInfo(this Exception ex)
Expand Down
6 changes: 3 additions & 3 deletions Infrastructure/RootCommandBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace CnCNetServer;

using System.CommandLine;
using System.CommandLine;
using System.CommandLine.NamingConventionBinder;
using System.CommandLine.Parsing;

namespace CnCNetServer;

internal static class RootCommandBuilder
{
private static readonly string[] NameOptionAliases = ["--name", "--n"];
Expand Down
6 changes: 3 additions & 3 deletions Infrastructure/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace CnCNetServer;

using System.Collections.Frozen;
using System.Collections.Frozen;
using System.CommandLine;
using System.CommandLine.Hosting;
using System.CommandLine.Invocation;
using Microsoft.Extensions.DependencyInjection;

namespace CnCNetServer;

internal static class Startup
{
public static void UseSocketsHttpHandler(SocketsHttpHandler socketsHttpHandler, IServiceProvider serviceProvider)
Expand Down
70 changes: 35 additions & 35 deletions cncnet-server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,41 @@
<PackageReference Include="System.CommandLine.NamingConventionBinder" Version="2.0.0-beta4.22272.1" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net9.0'">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Logging.EventSource" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.Diagnostics.EventLog" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="System.Text.Json" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.EventSource" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="System.Diagnostics.EventLog" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="System.Text.Encodings.Web" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="System.Text.Json" Version="9.0.0-rc.1.24431.7" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
Expand Down

0 comments on commit ab11ad5

Please sign in to comment.