C# 具有固定名称的ADO.NET提供程序';Oracle.DataAccess.Client';未注册
我在VS2015中开发了这个基于实体框架的web服务代码,该代码一直运行良好,直到我的系统被一个新系统取代。在一个全新的系统上,我无法在同一版本的Visual Studio中编译代码,即使我已经安装了所有依赖项,包括Oracle 11.2客户端运行时(它说,“安装用于开发应用程序、网络服务和基本客户端软件的工具”) 在VS2015中构建解决方案时,引发的错误是:C# 具有固定名称的ADO.NET提供程序';Oracle.DataAccess.Client';未注册,c#,.net,oracle,ado.net,C#,.net,Oracle,Ado.net,我在VS2015中开发了这个基于实体框架的web服务代码,该代码一直运行良好,直到我的系统被一个新系统取代。在一个全新的系统上,我无法在同一版本的Visual Studio中编译代码,即使我已经安装了所有依赖项,包括Oracle 11.2客户端运行时(它说,“安装用于开发应用程序、网络服务和基本客户端软件的工具”) 在VS2015中构建解决方案时,引发的错误是:error 175:具有固定名称“Oracle.DataAccess.Client”的ADO.NET提供程序未在计算机或应用程序配置文件
error 175:具有固定名称“Oracle.DataAccess.Client”的ADO.NET提供程序未在计算机或应用程序配置文件中注册,或者无法加载。有关详细信息,请参阅内部异常。
双击该错误会将我带到指向的EDMX文件和EDMX文件标记StorageModels>Schema:
有趣的是,虽然创建了DLL文件(尽管存在上述错误),但当我用这个新的DLL替换服务器上的现有DLL时,从数据库中提取数据时,似乎出现了以下问题:
System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)
at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
at MyCo.MyDept.MyIntegration.MyService.DataAccess.DAL.GetLocation() in C:\Users\xxxx\MyCo.MyDept.MyIntegration.MyService\DataAccess\DAL.cs:line 17
at MyCo.MyDept.MyIntegration.MyService.Utility.Helpers.GetLocations() in C:\Users\xxxx\MyCo.MyDept.MyIntegration.MyService\Utility\Helpers.cs:line 303
at MyCo.MyDept.MyIntegration.MyService.KService.GetLocations() in C:\Users\xxxx\MyCo.MyDept.MyIntegration.MyService\KService.svc.cs:line 71
我曾尝试过其他类似线程中提供的解决方案,但它们似乎都不起作用。感谢您的帮助。谢谢。检查配置文件中是否有以下内容。如果没有,则相应地添加它们
我怀疑问题与实际的EDMX文件无关,而是与设置(主要是App.config或Web.config)相关的配置文件,在快速搜索后,这些链接可能会对您有所帮助:我发现这些链接和任何解决方案似乎都不适合我。首先,我的web.config甚至没有
部分。基于实体框架的web服务是否必须在web.config中包含此部分以注册我使用的名称-“Oracle.DataAccess.Client”?它不一定必须是准确的名称,可以是类似于
的名称。你能发布你的web.config文件的部分/全部吗?这会有所帮助。web.config文件对于评论框来说似乎太大了。但这里有一部分引用了Oracle.DataAccess.Client:如果我需要查找某个特定的部分,请立即告诉我。我还用新的症状更新了原来的问题-如果有帮助的话。
<configSections><section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /></<configSections>
<entityFramework>
<providers>
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers></entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client"/>
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
</DbProviderFactories>