MiniAuth icon indicating copy to clipboard operation
MiniAuth copied to clipboard

Support AOT exe for windows/linux/mac

Open shps951023 opened this issue 2 years ago • 2 comments

PS D:\git\MiniAuth\MiniAuth.AOT> dotnet publish -r win-x64 -c Release
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj (in 2.25 sec).
  Restored D:\git\MiniAuth\src\MiniAuth\MiniAuth.csproj (in 7.28 sec).
  MiniAuth -> D:\git\MiniAuth\src\MiniAuth\bin\Release\net5.0\MiniAuth.dll
  MiniAuth.AOT -> D:\git\MiniAuth\MiniAuth.AOT\bin\Release\net8.0\win-x64\MiniAuth.AOT.dll
  Generating native code
C:\Users\Wei\.nuget\packages\stub.system.data.sqlite.core.netstandard\1.0.118\lib\netstandard2.1\System.Data.SQLite.dll
 : warning IL2104: Assembly 'System.Data.SQLite' produced trim warnings. For more information see https://aka.ms/dotnet
-illink/libraries [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
ILC : warning IL3000: System.Data.SQLite.SQLiteConnection.GetEeeCertificateFileName(): 'System.Reflection.Assembly.Loca
tion.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory
 is needed, consider calling 'System.AppContext.BaseDirectory'. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
ILC : warning IL3000: System.Data.SQLite.UnsafeNativeMethods.GetAssemblyDirectory(): 'System.Reflection.Assembly.Locati
on.get' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory i
s needed, consider calling 'System.AppContext.BaseDirectory'. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
ILC : warning IL3002: System.Data.SQLite.UnsafeNativeMethods.CheckAssemblyCodeBase(Assembly,String&): Using member 'Sys
tem.Reflection.Assembly.CodeBase.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded
in a single-file app. This member throws an exception for assemblies embedded in a single-file app. [D:\git\MiniAuth\Mi
niAuth.AOT\MiniAuth.AOT.csproj]
ILC : warning IL3000: System.Data.SQLite.SQLiteExtra.InnerVerify(String): 'System.Reflection.Assembly.Location.get' alw
ays returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, c
onsider calling 'System.AppContext.BaseDirectory'. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
ILC : warning IL3000: System.Data.SQLite.SQLiteExtra.InnerVerify(String): 'System.Reflection.Assembly.Location.get' alw
ays returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, c
onsider calling 'System.AppContext.BaseDirectory'. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
C:\Users\Wei\.nuget\packages\newtonsoft.json\13.0.2\lib\net6.0\Newtonsoft.Json.dll : warning IL2104: Assembly 'Newtonso
ft.Json' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [D:\git\MiniAuth\MiniA
uth.AOT\MiniAuth.AOT.csproj]
C:\Users\Wei\.nuget\packages\newtonsoft.json\13.0.2\lib\net6.0\Newtonsoft.Json.dll : warning IL3053: Assembly 'Newtonso
ft.Json' produced AOT analysis warnings. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6704): Trim analysis warning IL2026: System.Data.DataT
able.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataTable.ReadXmlSerializa
bleInternal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application
 code. DataTable.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may
 be trimmed if not referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3507): Trim analysis warning IL2026: System.Data.DataSet
.System.Xml.Serialization.IXmlSerializable.ReadXml(XmlReader): Using member 'System.Data.DataSet.ReadXmlSerializableInt
ernal(XmlReader)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code.
 DataSet.ReadXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trim
med if not referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6722): Trim analysis warning IL2026: System.Data.DataT
able.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataTable.WriteXmlInterna
l(XmlWriter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Dat
ed if not referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3529): Trim analysis warning IL2026: System.Data.DataSet
.System.Xml.Serialization.IXmlSerializable.WriteXml(XmlWriter): Using member 'System.Data.DataSet.WriteXmlInternal(XmlW
riter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.W
riteXml uses XmlSerialization underneath which is not trimming safe. Members from serialized types may be trimmed if no
t referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
C:\Users\Wei\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\8.0.0\framework\System.Linq.Expressions.dll :
warning IL3053: Assembly 'System.Linq.Expressions' produced AOT analysis warnings. [D:\git\MiniAuth\MiniAuth.AOT\MiniAu
th.AOT.csproj]
C:\Users\Wei\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\8.0.0\framework\System.Private.Xml.dll : warni
ng IL3053: Assembly 'System.Private.Xml' produced AOT analysis warnings. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csp
roj]
C:\Users\Wei\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\8.0.0\framework\Microsoft.CSharp.dll : warning
 IL3053: Assembly 'Microsoft.CSharp' produced AOT analysis warnings. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataTable.cs(6668): Trim analysis warning IL2026: System.Data.DataT
able.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataTable.GetXmlSchema()' which h
as 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataTable.GetSchema uses
 TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types may be trimm
ed if not referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
/_/src/libraries/System.Data.Common/src/System/Data/DataSet.cs(3473): Trim analysis warning IL2026: System.Data.DataSet
.System.Xml.Serialization.IXmlSerializable.GetSchema(): Using member 'System.Data.DataSet.WriteXmlSchema(DataSet,XmlWri
ter)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. DataSet.Get
Schema uses TypeDescriptor and XmlSerialization underneath which are not trimming safe. Members from serialized types m
ay be trimmed if not referenced directly. [D:\git\MiniAuth\MiniAuth.AOT\MiniAuth.AOT.csproj]
  MiniAuth.AOT -> D:\git\MiniAuth\MiniAuth.AOT\bin\Release\net8.0\win-x64\publish\
PS C:\Users\Wei> D:\git\MiniAuth\MiniAuth.AOT\bin\Release\net8.0\win-x64\publish\MiniAuth.AOT.exe
crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
       ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
         at System.ArgumentNullException.Throw(String) + 0x2b
         at System.IO.Path.Combine(String, String) + 0x23
         at System.Data.SQLite.SQLiteConnection..ctor(String, Boolean) + 0x204
         at System.Activator.CreateInstance[T]() + 0x34
         --- End of inner exception stack trace ---
         at System.Activator.CreateInstance[T]() + 0xa5
         at MiniAuth.MiniAuthDB`1.<>c__DisplayClass3_0.<.ctor>b__0() + 0x1e
         at MiniAuth.MiniAuthDB`1..ctor(String) + 0x12c
         at MiniAuth.MiniAuthMiddleware..ctor(RequestDelegate next, ILoggerFactory loggerFactory, IWebHostEnvironment hostingEnv, ILogger`1 logger, IJWTManager jwtManager, MiniAuthOptions options, IRolePermissionManager permissionManager, IUserManager userManager, IEnumerable`1 endpointSources, IMiniAuthDB db) + 0xaa
         at MiniAuth.AOT!<BaseAddress>+0xc357e5
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x16f
         at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xeb
         at Internal.Reflection.Execution.MethodInvokers.InstanceMethodInvoker.CreateInstance(Object[], BinderBundle, Boolean) + 0x44
         at Internal.Reflection.Core.Execution.MethodBaseInvoker.CreateInstance(Object[], Binder, BindingFlags, CultureInfo) + 0x3b
         at System.Reflection.Runtime.MethodInfos.RuntimePlainConstructorInfo`1.Invoke(BindingFlags, Binder, Object[], CultureInfo) + 0x55
         at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider) + 0xc5
         at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider, Type, Object[]) + 0xf9
         at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.ReflectionMiddlewareBinder.CreateMiddleware(RequestDelegate next) + 0xc4
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.<StartAsync>d__40.MoveNext() + 0x511
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
       ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
         at System.ArgumentNullException.Throw(String) + 0x2b
         at System.IO.Path.Combine(String, String) + 0x23
         at System.Data.SQLite.SQLiteConnection..ctor(String, Boolean) + 0x204
         at System.Activator.CreateInstance[T]() + 0x34
         --- End of inner exception stack trace ---
         at System.Activator.CreateInstance[T]() + 0xa5
         at MiniAuth.MiniAuthDB`1.<>c__DisplayClass3_0.<.ctor>b__0() + 0x1e
         at MiniAuth.MiniAuthDB`1..ctor(String) + 0x12c
         at MiniAuth.MiniAuthMiddleware..ctor(RequestDelegate next, ILoggerFactory loggerFactory, IWebHostEnvironment hostingEnv, ILogger`1 logger, IJWTManager jwtManager, MiniAuthOptions options, IRolePermissionManager permissionManager, IUserManager userManager, IEnumerable`1 endpointSources, IMiniAuthDB db) + 0xaa
         at MiniAuth.AOT!<BaseAddress>+0xc357e5
         at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x16f
         at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xeb
         at Internal.Reflection.Execution.MethodInvokers.InstanceMethodInvoker.CreateInstance(Object[], BinderBundle, Boolean) + 0x44
         at Internal.Reflection.Core.Execution.MethodBaseInvoker.CreateInstance(Object[], Binder, BindingFlags, CultureInfo) + 0x3b
         at System.Reflection.Runtime.MethodInfos.RuntimePlainConstructorInfo`1.Invoke(BindingFlags, Binder, Object[], CultureInfo) + 0x55
         at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider) + 0xc5
         at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider, Type, Object[]) + 0xf9
         at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.ReflectionMiddlewareBinder.CreateMiddleware(RequestDelegate next) + 0xc4
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.<StartAsync>d__40.MoveNext() + 0x9f6
      --- End of stack trace from previous location ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
         at Microsoft.Extensions.Hosting.Internal.Host.<<StartAsync>b__15_1>d.MoveNext() + 0xbb
      --- End of stack trace from previous location ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
         at Microsoft.Extensions.Hosting.Internal.Host.<ForeachService>d__18`1.MoveNext() + 0x3d8
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.ArgumentNullException.Throw(String) + 0x2b
   at System.IO.Path.Combine(String, String) + 0x23
   at System.Data.SQLite.SQLiteConnection..ctor(String, Boolean) + 0x204
   at System.Activator.CreateInstance[T]() + 0x34
   --- End of inner exception stack trace ---
   at System.Activator.CreateInstance[T]() + 0xa5
   at MiniAuth.MiniAuthDB`1.<>c__DisplayClass3_0.<.ctor>b__0() + 0x1e
   at MiniAuth.MiniAuthDB`1..ctor(String) + 0x12c
   at MiniAuth.MiniAuthMiddleware..ctor(RequestDelegate next, ILoggerFactory loggerFactory, IWebHostEnvironment hostingEnv, ILogger`1 logger, IJWTManager jwtManager, MiniAuthOptions options, IRolePermissionManager permissionManager, IUserManager userManager, IEnumerable`1 endpointSources, IMiniAuthDB db) + 0xaa
   at MiniAuth.AOT!<BaseAddress>+0xc357e5
   at System.Reflection.DynamicInvokeInfo.InvokeWithManyArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0x16f
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xeb
   at Internal.Reflection.Execution.MethodInvokers.InstanceMethodInvoker.CreateInstance(Object[], BinderBundle, Boolean) + 0x44
   at Internal.Reflection.Core.Execution.MethodBaseInvoker.CreateInstance(Object[], Binder, BindingFlags, CultureInfo) + 0x3b
   at System.Reflection.Runtime.MethodInfos.RuntimePlainConstructorInfo`1.Invoke(BindingFlags, Binder, Object[], CultureInfo) + 0x55
   at Microsoft.Extensions.Internal.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider) + 0xc5
   at Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider, Type, Object[]) + 0xf9
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.ReflectionMiddlewareBinder.CreateMiddleware(RequestDelegate next) + 0xc4
   at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
   at Microsoft.AspNetCore.Builder.ApplicationBuilder.Build() + 0x73
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.<StartAsync>d__40.MoveNext() + 0x9f6
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at Microsoft.Extensions.Hosting.Internal.Host.<<StartAsync>b__15_1>d.MoveNext() + 0xbb
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at Microsoft.Extensions.Hosting.Internal.Host.<ForeachService>d__18`1.MoveNext() + 0x3d8
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>g__LogAndRethrow|15_3(Host.<>c__DisplayClass15_0&) + 0x62
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__15.MoveNext() + 0x5c2
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext() + 0x11a
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext() + 0x308
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x20
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0xb2
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task, ConfigureAwaitOptions) + 0x4b
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost) + 0x26
   at MiniAuth.AOT!<BaseAddress>+0xaee753

shps951023 avatar Feb 18 '24 02:02 shps951023

Image

shps951023 avatar Apr 05 '24 06:04 shps951023

crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
      System.InvalidOperationException: Model building is not supported when publishing with NativeAOT. Use a compiled model.
         at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel(Boolean designTime)
         at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
         at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__8_4(IServiceProvider p)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
         at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
         at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
         at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService(IInfrastructure`1 accessor, Type serviceType)
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
         at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
         at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()
         at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()
         at MiniAuthIdentityBuilderExtensions.<>c__DisplayClass0_0`3.<<UseMiniAuth>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at MiniAuthIdentityBuilderExtensions.UseMiniAuth[TDbContext,TIdentityUser,TIdentityRole](IApplicationBuilder builder)
         at MiniAuth.Identity.MiniAuthStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
fail: Microsoft.Extensions.Hosting.Internal.Host[11]
      Hosting failed to start
      System.InvalidOperationException: Model building is not supported when publishing with NativeAOT. Use a compiled model.
         at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel(Boolean designTime)
         at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
         at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__8_4(IServiceProvider p)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
         at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
         at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
         at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
         at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
         at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
         at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService(IInfrastructure`1 accessor, Type serviceType)
         at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
         at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
         at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()
         at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.EnsureCreated()
         at MiniAuthIdentityBuilderExtensions.<>c__DisplayClass0_0`3.<<UseMiniAuth>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at MiniAuthIdentityBuilderExtensions.UseMiniAuth[TDbContext,TIdentityUser,TIdentityRole](IApplicationBuilder builder)
         at MiniAuth.Identity.MiniAuthStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
         at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
         at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
         at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)






shps951023 avatar Jun 02 '24 14:06 shps951023