mini-software / MiniAuth

[Beta status] Plugin Identity Auth System in ONE Line of Code for your project (Like Swagger)
https://www.nuget.org/packages/MiniAuth
Apache License 2.0
23 stars 4 forks source link

Avoid init error to shut down app #115

Closed shps951023 closed 1 month ago

shps951023 commented 1 month ago

Image

Image

shps951023 commented 1 month ago
  System.InvalidOperationException: BeginExecuteNonQuery requires the command to have a transaction when the connection assigned to the command is in a pending local transaction.  The Transaction property of the command has not been initialized.
         at System.Data.SqlClient.SqlCommand.ValidateCommand(Boolean async, String method)
         at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String methodName)
         at System.Data.SqlClient.SqlCommand.BeginExecuteNonQuery(AsyncCallback callback, Object stateObject)
         at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl(Func`3 beginMethod, Func`2 endFunction, Action`1 endAction, Object state, TaskCreationOptions creationOptions)
         at System.Threading.Tasks.TaskFactory`1.FromAsync(Func`3 beginMethod, Func`2 endMethod, Object state)
         at System.Data.SqlClient.SqlCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
      --- End of stack trace from previous location ---
         at MiniAuth.Managers.RoleEndpointManager.InsertNewEndpoint(DbConnection connection, List`1 endpoints) in D:\git\MiniAuth\src\MiniAuth\Managers\RoleEndpointManager.cs:line 97
         at MiniAuth.Managers.RoleEndpointManager.GetAndInitEndpointsAsync(IEnumerable`1 _endpointSources) in D:\git\MiniAuth\src\MiniAuth\Managers\RoleEndpointManager.cs:line 34
         at MiniAuth.MiniAuthMiddleware.Invoke(HttpContext context) in D:\git\MiniAuth\src\MiniAuth\MiniAuthMiddleware.cs:line 107
         at MiniAuth.MiniAuthMiddleware.Invoke(HttpContext context) in D:\git\MiniAuth\src\MiniAuth\MiniAuthMiddleware.cs:line 222
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
         at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)