Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 实体框架6未能加载System.Data.SqlClient_C#_Entity Framework - Fatal编程技术网

C# 实体框架6未能加载System.Data.SqlClient

C# 实体框架6未能加载System.Data.SqlClient,c#,entity-framework,C#,Entity Framework,我最近在服务器上部署了应用程序,但我对EntityFramework6有意见。它以这种方式失败。在部署/配置更改后的第一次尝试中,我遇到以下错误: [ConfigurationErrorsException: The 'DbProviderFactories' section can only appear once per config file.] System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] key

我最近在服务器上部署了应用程序,但我对EntityFramework6有意见。它以这种方式失败。在部署/配置更改后的第一次尝试中,我遇到以下错误:

[ConfigurationErrorsException: The 'DbProviderFactories' section can only appear once per config file.]
   System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) +834506
   System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) +836240
   System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +853722
   System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +853722
   System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +853722
   System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +853722
   System.Configuration.BaseConfigurationRecord.GetSection(String configKey) +69
   System.Configuration.ConfigurationManager.GetSection(String sectionName) +140
   System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) +43
   System.Data.Common.DbProviderFactories.Initialize() +218
   System.Data.Common.DbProviderFactories.GetProviderTable() +9
   System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup) +146
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +83
   System.Data.Entity.Infrastructure.DependencyResolution.CachingDependencyResolver.GetService(Type type, Object key) +179
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
   System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key) +71
   System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService(IDbDependencyResolver resolver, Object key) +84
   System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +691
   System.Data.Entity.Core.EntityClient.EntityConnection..ctor(String connectionString) +141
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +186
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +95
   System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +16
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +408
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +68
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source, Expression`1 predicate) +85
   MobileDeviceDB.Controllers.AuthController.ShowIndex(LoginModel data) +1060
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +261
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +34
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +124
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +839035
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +33
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +839620
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +65
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +51
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
[ConfigurationErrorsException:“DbProviderFactorys”部分在每个配置文件中只能出现一次。]
System.Configuration.BaseConfigurationRecord.EvaluateOne(字符串[]键,SectionInput输入,布尔isTrusted,FactoryRecord FactoryRecord,SectionRecord SectionRecord,Object parentResult)+834506
System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord FactoryRecord、SectionRecord SectionRecord、Object parentResult、Boolean getLkg、Boolean getRuntimeObject、Object&result、Object&resultRuntimeObject)+836240
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(字符串configKey、布尔getLkg、布尔checkPermission、布尔getRuntimeObject、布尔RequestISHER、对象与结果、对象与结果EntimeObject)+853722
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(字符串configKey、布尔getLkg、布尔checkPermission、布尔getRuntimeObject、布尔RequestISHER、对象与结果、对象与结果EntimeObject)+853722
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(字符串configKey、布尔getLkg、布尔checkPermission、布尔getRuntimeObject、布尔RequestISHER、对象与结果、对象与结果EntimeObject)+853722
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(字符串configKey、布尔getLkg、布尔checkPermission、布尔getRuntimeObject、布尔RequestISHER、对象与结果、对象与结果EntimeObject)+853722
System.Configuration.BaseConfigurationRecord.GetSection(字符串configKey)+69
System.Configuration.ConfigurationManager.GetSection(字符串sectionName)+140
System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)+43
System.Data.Common.dbProviderFactorys.Initialize()+218
System.Data.Common.dbProviderFactorys.GetProviderTable()+9
System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(类型、对象键、Func`3 handleFailedLookup)+146
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey,Func`2 valueFactory)+83
System.Data.Entity.Infrastructure.DependencyResolution.CachingDependencyResolver.GetService(类型,对象键)+179
System.Linq.WhereSelectArrayIterator`2.MoveNext()+82
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1源,Func`2谓词)+215
System.Linq.WhereSelectArrayIterator`2.MoveNext()+82
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1源,Func`2谓词)+215
System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(类型,对象键)+71
System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolvextensions.GetService(IDBDendencyResolver解析器,对象键)+84
System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)+691
System.Data.Entity.Core.EntityClient.EntityConnection..ctor(字符串连接字符串)+141
System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(字符串名称,AppConfig配置)+186
System.Data.Entity.Internal.LazyInternalConnection.Initialize()+95
System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()+16
System.Data.Entity.Internal.LazyInternalContext.InitializeContext()+408
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(类型entityType)+26
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()+72
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()+21
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()+68
System.Linq.Queryable.FirstOrDefault(IQueryable`1源,表达式`1谓词)+85
MobileDeviceDB.Controllers.AuthController.ShowIndex(登录模型数据)+1060
lambda_方法(闭包、控制器基、对象[])+79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext ControllerContext,IDictionary`2参数)+261
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext ControllerContext,ActionDescriptor ActionDescriptor,IDictionary`2参数)+39
System.Web.Mvc.Async.c__显示类42.b__41()+34
System.Web.Mvc.Async.c__显示类39.b__33()+124
System.Web.Mvc.Async.c__DisplayClass4f.b__49()+839035
System.Web.Mvc.Async.c__显示类37.b__36(IAsyncResult asyncResult)+15
System.Web.Mvc.Async.c__DisplayClass2a.b__20()+33
System.Web.Mvc.Async.c__显示类25.b__22(IAsyncResult asyncResult)+839620
System.Web.Mvc.c_uuudisplayClassId.b_uuu18(IAsyncResult asyncResult)+28
System.Web.Mvc.Async.c_uuuudisplayClass4.b_uuuu3(IAsyncResult ar)+15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+65
System.Web.Mvc.Async.c_uuuudisplayClass4.b_uuuu3(IAsyncResult ar)+15
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)+51
System.Web.Mvc.c_uuudisplayClass8.b_uuu3(IAsyncResult asyncResult)+42
System.Web.Mvc.Async.c_uuuudisplayClass4.b_uuuu3(IAsyncResult ar)+15
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)+51
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+606
System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值&同步完成)+288
刷新后,我得到了以下异常:

[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup) +282

[ArgumentException: The ADO.NET provider with invariant name 'System.Data.SqlClien' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.]
   System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.<GetService>b__0(ArgumentException e, String n) +58
   System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(Type type, Object key, Func`3 handleFailedLookup) +414
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +83
   System.Data.Entity.Infrastructure.DependencyResolution.CachingDependencyResolver.GetService(Type type, Object key) +179
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
   System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key) +71
   System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService(IDbDependencyResolver resolver, Object key) +84
   System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +691
   System.Data.Entity.Core.EntityClient.EntityConnection..ctor(String connectionString) +141
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +186
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +95
   System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +16
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +408
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +68
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source, Expression`1 predicate) +85
   MobileDeviceDB.Controllers.AuthController.ShowIndex(LoginModel data) +1060
   lambda_method(Closure , ControllerBase , Object[] ) +79
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +261
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +34
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +124
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +839035
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +15
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +33
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +839620
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +65
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +51
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
[ArgumentException:找不到请求的.Net Framework数据提供程序。它可能未安装。]
System.Data.Entity.Infrastructure.DependencyResolution.DefaultProviderFactoryResolver.GetService(类型、对象键、Func`3 handleFailedLookup)+282
[ArgumentException:具有固定名称'System.Data.SqlClien'的ADO.NET提供程序未在ma中注册