DotNet Core MVC算术运算导致溢出。创建控制器后

时间:2017-02-13 09:24:26

标签: c# asp.net-mvc entity-framework asp.net-core

在Visual Studio 2015企业版上使用最新的dotnet核心MVC。使用EntityFramework和MVC Views构建了一个新的Controller,其架构没有问题。但是,当我进入索引视图时,我明白了:

  

处理请求时发生未处理的异常。   OverflowException:算术运算导致溢出。   TryGetConnection

这是堆栈:

  

System.OverflowException:算术运算导致了   溢出。在   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection   owningObject,UInt32 waitForMultipleObjectsTimeout,Boolean   allowCreate,Boolean onlyOneCheckConnection,DbConnectionOptions   userOptions,DbConnectionInternal&连接)   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(的DbConnection   owningObject,TaskCompletionSource`1 retry,DbConnectionOptions   userOptions,DbConnectionInternal&连接)   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(的DbConnection   owningConnection,TaskCompletionSource`1重试,DbConnectionOptions   userOptions,DbConnectionInternal oldConnection,DbConnectionInternal&   连接)   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(的DbConnection   outerConnection,DbConnectionFactory connectionFactory,   TaskCompletionSource`1重试,DbConnectionOptions userOptions)at   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1   重试)在System.Data.SqlClient.SqlConnection.Open()处   Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open()
  在   Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerDatabaseCreator.Exists(布尔   retryOnNotExists)at   Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.d__6.MoveNext()   ---从抛出异常的先前位置开始的堆栈跟踪结束--- at   Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.d__6.MoveNext()   ---从抛出异常的先前位置开始的堆栈跟踪结束--- at   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务   任务)   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务   任务)   Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.d__6.MoveNext()

0 个答案:

没有答案