I can not get a provider for Oracle with Code First


I'm doing the following:

Model dou Add folder > New Item follows images








asked by anonymous 05.11.2015 / 13:14

1 answer


This is the terribly difficult way to work with the Oracle driver within ASP.NET MVC.

The easy way is to install the official Oracle NuGet package . There are two ways to do it:

  • In Visual Studio, go to Tools > Extensions and Updates > Look for the package there. I do not recommend this because sometimes the package does not appear;
  • In Visual Studio, go to View > Other Windows > Package Manager Console and type in it:

    PM> Install-Package Oracle.ManagedDataAccess.EntityFramework
  • Once this is done, open your Web.config and locate the <entityFramework> tag. If any, replace the entire tag with the following:

        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
          <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework" />

    If it does not, put the above content before </configuration> .

    After this, your project is ready to work with the Entity Framework and Oracle.


    As you want the ADO.NET Entity Data Model Wizard, you will need to install the IDE adapter that allows you to use Oracle in the Wizard: Oracle Developer Tools for Visual Studio.

    You can download it here .

    05.11.2015 / 14:46