EmitKnowledge / Signals

Signals is a framework for developing enterprise and SaaS applications that follows the USE-CASE driven methodology
MIT License
59 stars 9 forks source link

.NET 8 support #50

Closed multimokia closed 3 weeks ago

multimokia commented 3 weeks ago

Seeing as dotnet 6 will be rendered EoL on November 12th, 2024 I wanted to know if there were plans to support dotnet 8.

According to Nuget, Signals.Core supports Net8, however I don't entirely think that's the case as on initialization, the application will crash throwing the following error:

System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load type 'SqlGuidCaster' from assembly 'System.Data.SqlClient, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at Signals.Core.Common.Reflection.ReflectionsHelper.LoadAllTypesFromAssembly(Assembly ass)
   at Signals.Core.Configuration.Bootstrapping.ApplicationBootstrapConfiguration.<>c.<Resolve>b__51_0(Assembly assembly)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.ToList()
   at Signals.Core.Configuration.Bootstrapping.ApplicationBootstrapConfiguration.Resolve(ConfigurationBootstrapper configurationBootstrapper, Assembly[] scanAssemblies)
   at Signals.Core.Configuration.Bootstrapping.ApplicationBootstrapConfiguration.Signals.Core.Configuration.Bootstrapping.IApplicationBootstrapConfiguration.Resolve(ConfigurationBootstrapper configurationBootstrapper, Assembly[] scanAssemblies)
   at Signals.Core.Web.Configuration.Bootstrapping.WebApplicationBootstrapConfigurationExtensions.BootstrapHelper(IWebApplicationBootstrapConfiguration webBootstrapConfiguration, Assembly[] scanAssemblies)
   at Signals.Core.Web.Configuration.Bootstrapping.FluentWebApplicationBootstrapConfiguration.Bootstrap(Assembly[] scanAssemblies)
   at Signals.Core.Web.Extensions.MiddlewareExtensions.AddSignals(IServiceCollection services, Action`1 configurationCallback)
   at App.Client.Web.Api.SignalsStartup.AddSignals(IServiceCollection services) in C:\Users\[REDACTED]\Documents\Git\[REDACTED]\src-api\03 Client\31 Web\App.Client.Web.Api\Startup.Signals.cs:line 85
   at App.Client.Web.Api.Startup.ConfigureServices(IServiceCollection services) in C:\Users\[REDACTED]\Documents\Git\[REDACTED]\src-api\03 Client\31 Web\App.Client.Web.Api\Startup.cs:line 55
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.<ConfigureServices>g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
System.TypeLoadException: Could not load type 'SqlGuidCaster' from assembly 'System.Data.SqlClient, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field.

Which looks like an issue between System.Data.SqlClient and Microsoft.Data.Sqlclient

I think the version within Signals is required to be updated?

multimokia commented 3 weeks ago

Apologies. This was an inter-product issue that was arisen.

multimokia commented 3 weeks ago

Reopening as there are usages of System.Data.Sqlclient internally within Signals.Core and Signals.Core.Background

Potentially upgrading may fix this issue?

multimokia commented 3 weeks ago

Update, looks like this comment resolves this: https://github.com/dotnet/SqlClient/issues/1930#issuecomment-2112646590

mnikolovski commented 1 week ago

This will be fixed with the migration to .NET8.