Error 0152: No Entity Framework provider found for 'Oracle.DataAccess.Client' ADO.NET provider
Asked Answered
P

0

7

I have Windows 7 x64, Visual Studio 2012 with the 'ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio (11.2.0.3.20)'. Then I connected to Oracle db, create .edmx model. But when I'm trying to use EF to operate some data

var ent = new Entities();
var res = ent.table1.ToList();

Error happends

Schema specified is not valid. Errors: 

Model.ssdl(2,2) : error 0152: No Entity Framework provider found for 
'Oracle.DataAccess.Client' ADO.NET provider. Make sure the provider is registered in 
the 'entityFramework' section of the application config file. See 
http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

I checked my AppConfig, all sections are ok. Also I installed ODAC1120320Xcopy_x64 (and added a environment variables too). But nothing changes.

If I do it in this way, all works fine

EntityConnection econn = new EntityConnection("name=Entities");
econn.Open();
EntityCommand ecmd = econn.CreateCommand();
ecmd.CommandText = "SELECT e.NAME FROM Entities.table1 as e";
EntityDataReader ereader = ecmd.ExecuteReader(CommandBehavior.SequentialAccess);
while (ereader.Read()) { ... }

Have you any ideas? Will be very grateful for any help.

Poppo answered 9/12, 2012 at 15:44 Comment(2)
What EF version are you using (EF5 or EF6)? How does your parameterless ctor look like. Show your config file.Brachyuran
Hi, Visual Studio is a x86 application, so it is the ODAC 11.2 Release 5 and Oracle Developer Tools for Visual Studio (11.2.0.3.20). Try the following, go to your project-->Properties-->Built-->Platform target. Change it from "Any Cpu" to "x86" and try if it conects in debug mode. If you want to deploy it to a x64 server with the EF x64 you have to change the plattform target.Workbench

© 2022 - 2024 — McMap. All rights reserved.