即使设置为本地系统帐户,也无法连接到api数据库

时间:2019-12-07 16:49:02

标签: asp.net-core

好的,希望大家能帮助我,因为我已经从这里安装了.net核心运行时托管包。

https://dotnet.microsoft.com/download/dotnet-core/3.1

我根据这篇Login failed for user 'IIS APPPOOL\ASP.NET v4.0'文章来设置我的凭据。

enter image description here

  

但是我什至说了以下话。

     

类别:Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer EventId:   2 RequestId:80000030-0000-fd00-b63f-84710c7967bb RequestPath:   / api /库存SpanId:| 516a341a-420f50da0e27f73a。 TraceId:   516a341a-420f50da0e27f73a ParentId:

     

连接ID“ 18230571293206380589”,请求ID   “ 80000030-0000-fd00-b63f-84710c7967bb”:未处理的异常是   由应用程序抛出。

     

异常:System.Data.SqlClient.SqlException(0x80131904):登录   用户“ IIS APPPOOL \ api.roundtable”失败。在   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection   owningObject,UInt32 waitForMultipleObjectsTimeout,布尔值   allowCreate,仅布尔值OneCheckConnection,DbConnectionOptions   userOptions,DbConnectionInternal&连接),位于   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection   owningObject,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource 1重试,DbConnectionOptions   userOptions,DbConnectionInternal oldConnection,DbConnectionInternal&   连接)   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection   externalConnection,DbConnectionFactory connectionFactory,   TaskCompletionSource 1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource 1重试,DbConnectionOptions userOptions)位于   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource 1 retry) at System.Data.SqlClient.SqlConnection.Open() at Dapper.SqlMapper.QueryImpl[T](IDbConnection cnn, CommandDefinition command, Type effectiveType)+MoveNext() in C:\projects\dapper\Dapper\SqlMapper.cs:line 1079 at System.Collections.Generic.List 1..ctor(IEnumerable 1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable
1源)位于   Dapper.SqlMapper.Query [T](IDbConnection cnn,字符串sql,对象参数,   IDbTransaction事务,布尔型缓冲,可空1 commandTimeout, Nullable 1 commandType)   C:\ projects \ dapper \ Dapper \ SqlMapper.cs:721行位于   RoundTableERPDal.RoundTableERPContext.GetAlLStock()在   D:\ GitMaster \ Freelancer \ SalesOrders \ DataAccessLayer \ SalesOrdersDL \ RoundTableERPContext.cs:line   132 at lambda_method(Closure,Object,Object [])在   Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object   目标,Object []参数)位于   Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper   映射器,ObjectMethodExecutor执行器,对象控制器,Object []   争论)   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()   在   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&   接下来,范围和作用域,对象和状态,布尔值和isCompleted)位于   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()   ---从上一个引发异常的位置开始的堆栈跟踪-   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed   上下文)   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&   接下来,范围和作用域,对象和状态,布尔值和isCompleted)位于   Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()   ---从上一个引发异常的位置开始的堆栈跟踪-   Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited | 19_0(ResourceInvoker   调用者,任务lastTask,状态下一个,作用域范围,对象状态,布尔值   isCompleted)   Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited | 17_0(ResourceInvoker   调用方,任务任务,IDisposable范围)   Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask | 6_0(Endpoint   端点,任务requestTask,ILogger记录器)位于   Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext   上下文)   Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext   httpContext)   Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext   httpContext,ISwaggerProvider swaggerProvider)位于   Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()   ClientConnectionId:efec08ee-d886-4d8b-8d69-fdb893bde5b1错误   编号:18456,状态:1,类别:14

作为默认SQL Server,应允许本地系统用户使用,我还需要为池标识创建一个用户。另外,为什么我的API站点不仅仅抛出数据库未连接的页面,而我却得到空白的页面。

0 个答案:

没有答案