diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50516f42..16df71cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,15 +45,20 @@ jobs: echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append shell: pwsh - - name: Setup .NET 5.0 + - name: Setup .NET 6.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.x + dotnet-version: 6.0.x - - name: Setup .NET 6.0 + - name: Setup .NET 7.0 uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x + dotnet-version: 7.0.x + + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore $SOLUTION diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d466e421..df19f0c9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,6 +29,16 @@ jobs: with: dotnet-version: 6.0.x + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.x + + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.2 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4dd61a36..01a168f8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -30,7 +30,7 @@ - + diff --git a/src/MADE.Data.Converters/MADE.Data.Converters.csproj b/src/MADE.Data.Converters/MADE.Data.Converters.csproj index c037feba..6392f291 100644 --- a/src/MADE.Data.Converters/MADE.Data.Converters.csproj +++ b/src/MADE.Data.Converters/MADE.Data.Converters.csproj @@ -1,7 +1,7 @@ - netstandard2.0;uap10.0.17763 + netstandard2.0;uap10.0.19041 MADE.NET Data Converters MADE.NET Data Converters provide out-of-the-box value converters for taking values of one type and changing them to another. diff --git a/src/MADE.Data.EFCore/MADE.Data.EFCore.csproj b/src/MADE.Data.EFCore/MADE.Data.EFCore.csproj index 05c3e3f8..9c6985ec 100644 --- a/src/MADE.Data.EFCore/MADE.Data.EFCore.csproj +++ b/src/MADE.Data.EFCore/MADE.Data.EFCore.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0;net8.0 MADE.NET for EF Core MADE.NET for EF Core builds on the base Entity Framework library to provide base classes and helpers for maintaining data in databases. @@ -9,9 +9,19 @@ MADE EFCore Entity Framework Extensions Queryable DbContext - - - + + + + + + + + + + + + + diff --git a/src/MADE.Data.Serialization/MADE.Data.Serialization.csproj b/src/MADE.Data.Serialization/MADE.Data.Serialization.csproj index 74e01434..d35c9044 100644 --- a/src/MADE.Data.Serialization/MADE.Data.Serialization.csproj +++ b/src/MADE.Data.Serialization/MADE.Data.Serialization.csproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/src/MADE.Data.Validation.FluentValidation/MADE.Data.Validation.FluentValidation.csproj b/src/MADE.Data.Validation.FluentValidation/MADE.Data.Validation.FluentValidation.csproj index bf50cfc5..0bc00a63 100644 --- a/src/MADE.Data.Validation.FluentValidation/MADE.Data.Validation.FluentValidation.csproj +++ b/src/MADE.Data.Validation.FluentValidation/MADE.Data.Validation.FluentValidation.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/MADE.Diagnostics/AppDiagnostics.cs b/src/MADE.Diagnostics/AppDiagnostics.cs index fde4474b..1681f876 100644 --- a/src/MADE.Diagnostics/AppDiagnostics.cs +++ b/src/MADE.Diagnostics/AppDiagnostics.cs @@ -14,10 +14,6 @@ namespace MADE.Diagnostics /// public class AppDiagnostics : IAppDiagnostics { -#if __ANDROID__ - private UncaughtExceptionHandler javaExceptionHandler; -#endif - /// /// Initializes a new instance of the class. /// @@ -63,17 +59,9 @@ public async Task StartRecordingDiagnosticsAsync() #if WINDOWS_UWP Windows.UI.Xaml.Application.Current.UnhandledException += this.OnAppUnhandledException; -#elif NETSTANDARD2_0 || __ANDROID__ || __IOS__ +#elif NETSTANDARD2_0 AppDomain.CurrentDomain.UnhandledException += this.OnAppUnhandledException; #endif - -#if __ANDROID__ - Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser += this.OnAndroidAppUnhandledException; - - this.javaExceptionHandler = new UncaughtExceptionHandler(this.OnJavaUncaughtException); - Java.Lang.Thread.DefaultUncaughtExceptionHandler = this.javaExceptionHandler; -#endif - TaskScheduler.UnobservedTaskException += this.OnTaskUnobservedException; await Task.CompletedTask; @@ -91,14 +79,9 @@ public void StopRecordingDiagnostics() #if WINDOWS_UWP Windows.UI.Xaml.Application.Current.UnhandledException -= this.OnAppUnhandledException; -#elif NETSTANDARD2_0 || __ANDROID__ || __IOS__ +#elif NETSTANDARD2_0 AppDomain.CurrentDomain.UnhandledException -= this.OnAppUnhandledException; #endif - -#if __ANDROID__ - Android.Runtime.AndroidEnvironment.UnhandledExceptionRaiser -= this.OnAndroidAppUnhandledException; -#endif - TaskScheduler.UnobservedTaskException -= this.OnTaskUnobservedException; this.IsRecordingDiagnostics = false; @@ -128,7 +111,7 @@ private void OnAppUnhandledException(object sender, Windows.UI.Xaml.UnhandledExc ? $"An unhandled exception was thrown. Error: {args.Exception}" : "An unhandled exception was thrown. Error: No exception information was available."); } -#elif NETSTANDARD2_0 || __ANDROID__ || __IOS__ +#elif NETSTANDARD2_0 private void OnAppUnhandledException(object sender, UnhandledExceptionEventArgs args) { if (args.IsTerminating) @@ -149,29 +132,5 @@ private void OnAppUnhandledException(object sender, UnhandledExceptionEventArgs this.ExceptionObserved?.Invoke(this, new ExceptionObservedEventArgs(correlationId, ex)); } #endif - -#if __ANDROID__ - private void OnAndroidAppUnhandledException(object sender, Android.Runtime.RaiseThrowableEventArgs args) - { - args.Handled = true; - - var correlationId = Guid.NewGuid(); - - this.EventLogger.WriteCritical($"An unhandled exception was thrown. Correlation ID: {correlationId}. Error: {args.Exception}."); - this.ExceptionObserved?.Invoke(this, new ExceptionObservedEventArgs(correlationId, args.Exception)); - } - - private void OnJavaUncaughtException(Exception ex) - { - var correlationId = Guid.NewGuid(); - - this.EventLogger.WriteCritical( - ex != null - ? $"An unhandled exception was thrown. Correlation ID: {correlationId}. Error: {ex}." - : $"An unhandled exception was thrown. Correlation ID: {correlationId}. Error: No exception information was available."); - - this.ExceptionObserved?.Invoke(this, new ExceptionObservedEventArgs(correlationId, ex)); - } -#endif } } \ No newline at end of file diff --git a/src/MADE.Diagnostics/Exceptions/UncaughtExceptionHandler.Android.cs b/src/MADE.Diagnostics/Exceptions/UncaughtExceptionHandler.Android.cs deleted file mode 100644 index 17bb8890..00000000 --- a/src/MADE.Diagnostics/Exceptions/UncaughtExceptionHandler.Android.cs +++ /dev/null @@ -1,40 +0,0 @@ -// MADE Apps licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -#if __ANDROID__ -namespace MADE.Diagnostics.Exceptions -{ - using System; - - using Java.Lang; - - using Object = Java.Lang.Object; - - /// - /// Defines an implementation of a Java uncaught exception handler. - /// - public class UncaughtExceptionHandler : Object, Thread.IUncaughtExceptionHandler - { - private readonly Action onException; - - /// - /// Initializes a new instance of the class. - /// - /// The action that will be called when an exception is observed. - public UncaughtExceptionHandler(Action onException) - { - this.onException = onException; - } - - /// - /// Called when an uncaught exception is observed. - /// - /// The thread where the exception originated from. - /// The exception. - public void UncaughtException(Thread t, Throwable e) - { - this.onException?.Invoke(e); - } - } -} -#endif \ No newline at end of file diff --git a/src/MADE.Diagnostics/MADE.Diagnostics.csproj b/src/MADE.Diagnostics/MADE.Diagnostics.csproj index 7203d202..58b89c6b 100644 --- a/src/MADE.Diagnostics/MADE.Diagnostics.csproj +++ b/src/MADE.Diagnostics/MADE.Diagnostics.csproj @@ -1,7 +1,7 @@ - netstandard2.0;uap10.0.17763;xamarinios10;xamarinmac20;MonoAndroid10.0 + netstandard2.0;uap10.0.19041 MADE.NET Diagnostics MADE.NET Diagnostics provides helpers to make debugging and logging results in your applications easier. @@ -9,7 +9,7 @@ MADE Diagnostics Extensions Logging EventLog Logger Exception Stopwatch - + diff --git a/src/MADE.Networking/MADE.Networking.csproj b/src/MADE.Networking/MADE.Networking.csproj index 3f8a6bf6..a0fe56ac 100644 --- a/src/MADE.Networking/MADE.Networking.csproj +++ b/src/MADE.Networking/MADE.Networking.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/MADE.Web.Mvc/MADE.Web.Mvc.csproj b/src/MADE.Web.Mvc/MADE.Web.Mvc.csproj index f6ef5fba..513b9a29 100644 --- a/src/MADE.Web.Mvc/MADE.Web.Mvc.csproj +++ b/src/MADE.Web.Mvc/MADE.Web.Mvc.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0;net8.0 MADE.NET for ASP.NET Core MVC MADE.NET for ASP.NET Core MVC builds on features of ASP.NET Core MVC to provide additional MVC-specific functionality to improve your web applications. @@ -14,7 +14,7 @@ - + diff --git a/src/MADE.Web/Extensions/ApiVersioningExtensions.cs b/src/MADE.Web/Extensions/ApiVersioningExtensions.cs index 7df9d1b6..bd1cd483 100644 --- a/src/MADE.Web/Extensions/ApiVersioningExtensions.cs +++ b/src/MADE.Web/Extensions/ApiVersioningExtensions.cs @@ -3,8 +3,7 @@ namespace MADE.Web.Extensions { - using Microsoft.AspNetCore.Mvc; - using Microsoft.AspNetCore.Mvc.Versioning; + using Asp.Versioning; using Microsoft.Extensions.DependencyInjection; /// @@ -24,15 +23,15 @@ public static IServiceCollection AddApiVersionSupport( int defaultMajor = 1, int defaultMinor = 0) { - services.AddVersionedApiExplorer(options => options.GroupNameFormat = "'v'VVV"); - - services.AddApiVersioning(options => + var apiVersioningBuilder = services.AddApiVersioning(options => { options.DefaultApiVersion = new ApiVersion(defaultMajor, defaultMinor); options.AssumeDefaultVersionWhenUnspecified = true; options.ReportApiVersions = true; }); + apiVersioningBuilder.AddApiExplorer(options => options.GroupNameFormat = "'v'VVV"); + return services; } @@ -50,9 +49,7 @@ public static IServiceCollection AddApiVersionHeaderSupport( int defaultMajor = 1, int defaultMinor = 0) { - services.AddVersionedApiExplorer(options => options.GroupNameFormat = "'v'VVV"); - - services.AddApiVersioning(options => + var apiVersioningBuilder = services.AddApiVersioning(options => { options.DefaultApiVersion = new ApiVersion(defaultMajor, defaultMinor); options.AssumeDefaultVersionWhenUnspecified = true; @@ -60,6 +57,8 @@ public static IServiceCollection AddApiVersionHeaderSupport( options.ApiVersionReader = new HeaderApiVersionReader(apiHeaderName); }); + apiVersioningBuilder.AddApiExplorer(options => options.GroupNameFormat = "'v'VVV"); + return services; } } diff --git a/src/MADE.Web/MADE.Web.csproj b/src/MADE.Web/MADE.Web.csproj index 4185900a..6d35ce40 100644 --- a/src/MADE.Web/MADE.Web.csproj +++ b/src/MADE.Web/MADE.Web.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0;net8.0 MADE.NET for ASP.NET Core MADE.NET for ASP.NET Core builds on features of ASP.NET Core to provide better support for your web API or MVC applications, including standardized pagination support, global authenticated user accessor, standardized exception handling with JSON responses, and API versioning. @@ -14,9 +14,22 @@ - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 22d2949f..af336dfc 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/tests/MADE.Collections.Tests/MADE.Collections.Tests.csproj b/tests/MADE.Collections.Tests/MADE.Collections.Tests.csproj index 92ddba54..0fb12829 100644 --- a/tests/MADE.Collections.Tests/MADE.Collections.Tests.csproj +++ b/tests/MADE.Collections.Tests/MADE.Collections.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Data.Converters.Tests/MADE.Data.Converters.Tests.csproj b/tests/MADE.Data.Converters.Tests/MADE.Data.Converters.Tests.csproj index f298d7a6..1036afdc 100644 --- a/tests/MADE.Data.Converters.Tests/MADE.Data.Converters.Tests.csproj +++ b/tests/MADE.Data.Converters.Tests/MADE.Data.Converters.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Data.EFCore.Tests/MADE.Data.EFCore.Tests.csproj b/tests/MADE.Data.EFCore.Tests/MADE.Data.EFCore.Tests.csproj index 9f8434d9..96b77e9e 100644 --- a/tests/MADE.Data.EFCore.Tests/MADE.Data.EFCore.Tests.csproj +++ b/tests/MADE.Data.EFCore.Tests/MADE.Data.EFCore.Tests.csproj @@ -1,25 +1,36 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + - + + + + + + + + + + + + + + diff --git a/tests/MADE.Data.Serialization.Tests/MADE.Data.Serialization.Tests.csproj b/tests/MADE.Data.Serialization.Tests/MADE.Data.Serialization.Tests.csproj index 4eaa96f0..575c151e 100644 --- a/tests/MADE.Data.Serialization.Tests/MADE.Data.Serialization.Tests.csproj +++ b/tests/MADE.Data.Serialization.Tests/MADE.Data.Serialization.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Data.Validation.FluentValidation.Tests/MADE.Data.Validation.FluentValidation.Tests.csproj b/tests/MADE.Data.Validation.FluentValidation.Tests/MADE.Data.Validation.FluentValidation.Tests.csproj index 19e1c853..fac54b2b 100644 --- a/tests/MADE.Data.Validation.FluentValidation.Tests/MADE.Data.Validation.FluentValidation.Tests.csproj +++ b/tests/MADE.Data.Validation.FluentValidation.Tests/MADE.Data.Validation.FluentValidation.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Data.Validation.Tests/MADE.Data.Validation.Tests.csproj b/tests/MADE.Data.Validation.Tests/MADE.Data.Validation.Tests.csproj index 3d5a3370..5016b022 100644 --- a/tests/MADE.Data.Validation.Tests/MADE.Data.Validation.Tests.csproj +++ b/tests/MADE.Data.Validation.Tests/MADE.Data.Validation.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Diagnostics.Tests/MADE.Diagnostics.Tests.csproj b/tests/MADE.Diagnostics.Tests/MADE.Diagnostics.Tests.csproj index c72364f3..5eb05f6e 100644 --- a/tests/MADE.Diagnostics.Tests/MADE.Diagnostics.Tests.csproj +++ b/tests/MADE.Diagnostics.Tests/MADE.Diagnostics.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Networking.Tests/MADE.Networking.Tests.csproj b/tests/MADE.Networking.Tests/MADE.Networking.Tests.csproj index 96853c42..227227d5 100644 --- a/tests/MADE.Networking.Tests/MADE.Networking.Tests.csproj +++ b/tests/MADE.Networking.Tests/MADE.Networking.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + diff --git a/tests/MADE.Web.Tests/MADE.Web.Tests.csproj b/tests/MADE.Web.Tests/MADE.Web.Tests.csproj index b0dc180d..25b68e5c 100644 --- a/tests/MADE.Web.Tests/MADE.Web.Tests.csproj +++ b/tests/MADE.Web.Tests/MADE.Web.Tests.csproj @@ -1,20 +1,20 @@ - net6.0 + net6.0;net7.0;net8.0 false - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - +