Skip to Main Content

Oracle Developer Tools for Visual Studio

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

EF Model Wizard Crashes

98bdd084-706d-46fc-b690-5b11edf310f5May 28 2015 — edited Jun 1 2015

Here's the list of currently installed software and their versions:

  • Oracle DB 11g 11.2.0.3.0
  • Visual Studio Professional 2013 12.0.21005.1
  • .NET framework 4.5.51209
  • Entity Framework 6.0.2
  • 12C ODP.NET Manager Driver 12.1.021

Now the problem: I'm trying to create a MVC application that connects to a Oracle DB. The Models will be created based on existing views in the Oracle DB(forced to be this way). So I've created the base MVC application in Visual Studio, installed EF and ODP. Now the fun begins. If I go into  Visual Studio's Server Explorer and add a new connection there to my Oracle db(TNS or EZConnect) it can connect and I can see the views that I want and query them(Just to prove that Oracle isn't out of reach). Now when I switch over to my project do the following:

  1. Right click on the Model folder and do Add-> ADO.NET Entity Data Model
  2. Name it Person, hit OK
  3. Select the Generate from Database, hit Next
  4. "OracleDbContext" is the connection that is selected. I get the blue processing circle for a few seconds and then wizard disappears.

From what I've been able to gather is that it is trying to connect to my Oracle db on that screen so that I can go on to choose tables/views and so on. Why it's failing there I'm not sure I'm using the same connection details, user, password as I did in the server explorer which works fine. I'll paste my web.config below(Have to sanitize but I've triple checked all spelling):

<?xml version="1.0" encoding="utf-8"?>

<!--

  For more information on how to configure your ASP.NET application, please visit

  http://go.microsoft.com/fwlink/?LinkId=301880

  -->

<configuration>

  <configSections>

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

  <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->

  <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

  </configSections>

  <connectionStrings>

    <add name="OracleDbContext" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=DBA_USER_VALUE;Password=PASSWORD_VALUE;Data Source=oracle" />

</connectionStrings>

  <appSettings>

    <add key="webpages:Version" value="3.0.0.0" />

    <add key="webpages:Enabled" value="false" />

    <add key="ClientValidationEnabled" value="true" />

    <add key="UnobtrusiveJavaScriptEnabled" value="true" />

  </appSettings>

  <system.web>

    <authentication mode="None" />

    <compilation debug="true" targetFramework="4.5" />

    <httpRuntime targetFramework="4.5" />

  </system.web>

  <system.webServer>

    <modules>

      <remove name="FormsAuthenticationModule" />

    </modules>

  </system.webServer>

  <runtime>

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

      <dependentAssembly>

        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />

        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />

      </dependentAssembly>

      <dependentAssembly>

        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />

        <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />

      </dependentAssembly>

      <dependentAssembly>

        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />

        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />

      </dependentAssembly>

      <dependentAssembly>

        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />

        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />

      </dependentAssembly>

      <dependentAssembly>

        <publisherPolicy apply="no" />

        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />

      </dependentAssembly>

    </assemblyBinding>

  </runtime>

  <entityFramework>

    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">

      <parameters>

        <parameter value="v11.0" />

      </parameters>

    </defaultConnectionFactory>

    <providers>

      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />

      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.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.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

    </DbProviderFactories>

  </system.data>

  <oracle.manageddataaccess.client>

    <version number="*">

      <dataSources>

       <dataSource alias="OracleDbContext" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=HOST_VALUE)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SERVICE_VALUE))) " />

      </dataSources>

    </version>

  </oracle.manageddataaccess.client>

</configuration>

(Just as a side note I also tested connecting to a MS SQL server and that worked instantly and I was able to create Models/my whole application)

Not sure if there is a "code" format for the config details. Let me know if you need additional information. Any help with this would be greatly appreciated. Thanks

This post has been answered by 98bdd084-706d-46fc-b690-5b11edf310f5 on Jun 1 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2015
Added on May 28 2015
5 comments
4,855 views