This discussion is archived
11 Replies Latest reply: Dec 14, 2012 4:36 AM by Tridus RSS

ODP.NET (11.2.0.3.20) breaks EF Update Wizard

961763 Newbie
Currently Being Moderated
I have VS2012 and the latest 32-bit version of ODAC (Release 5 with Oracle Developer Tools) installed on a Win7 box. Everything is a clean install. In this environment, I have an ASP.NET Web Forms solution that was originally developed in VS2010 with EDMX files that were built on 32-bit ODAC Release 4.

I am able to set up connections to the database and view tables using Server Explorer, but I am now unable to modify my EDMX files via the Update Wizard. No tables will show in the Update Wizard.

Here is the connection string from the first step of the VS2012 Update Wizard:

metadata=res://*/Models.EventModel.EventModel.csdl|
res://*/Models.EventModel.EventModel.ssdl|
res://*/Models.EventModel.EventModel.msl;
provider=Oracle.DataAccess.Client;
provider connection string="data source=<serverid>;
persist security info=True;
user id=<userid>"

However, on my other Win7 box, I have clean installs of VS2010, EF 4.1, and the previous 32-bit version of ODAC (Release 4) with the exact same ASP.NET solution, yet I have no problems with Update Wizard.

Here is the Update Wizard connection string from VS2010 and ODAC4:

metadata=res://*/Models.EventModel.EventModel.csdl|
res://*/Models.EventModel.EventModel.ssdl|
res://*/Models.EventModel.EventModel.msl;
provider=Oracle.DataAccess.Client;
provider connection string="DATA SOURCE=<serverid>;
PASSWORD=;
PERSIST SECURITY INFO=True";
USER ID=<userid>"

Other related info:

1) I am using the web.config from my VS2010/ODAC4 solution in my VS2012/ODAC5 solution.

2) I have set the VS2012 solution to target .NET 4.5.

3) I have made sure that EF5 is installed via NuGet and I have installed VS2012 Update 1.

4) I also set up a box with a clean install of VS2010 and ODAC5, and I encounter the same problem. No tables in Update Wizard.

Questions:

Are there any web.config settings or other settings that I need to change to solve this problem? If so, what are the settings?

Thanks in advance for your help. I'd really like to get going with the new ODAC and VS2012.

I have included screenshots with this question over at Stack Overflow.
http://stackoverflow.com/questions/13753139/latest-oracle-data-provider-for-net-11-2-0-3-20-breaks-ef-update-wizard

Edited by: 958760 on Dec 7, 2012 4:08 PM
  • 1. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    I mentioned this on SO just now - but have you tried opening the connection in server explorer and browsing to some tables right before trying to use it in the EF wizard? That always works for me (assuming its the same connection).
  • 2. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    961763 Newbie
    Currently Being Moderated
    @Tridus, thanks for your comment. Yes, I have tried that. As I said in the question, "I am able to set up connections to the database and view tables using Server Explorer." I still can't get any tables to show in the Update Wizard.
  • 3. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    Okay, just wanted to make sure. :) If you create a new EF model alongside the one that isn't working, does the new one work?
  • 4. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    961763 Newbie
    Currently Being Moderated
    I am not able to create a new model, nor am I able to add tables to existing models. Either way, the tables do not show up in the wizard. Server Explorer connects fine.
  • 5. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    That's really strange. Normally if you can't see tables in EF, you also can't see them in Server Explorer. Changing the schema filters in the server explorer connection to add the schema should fix it in both places at once for that connection.

    There's nothing special in web.config (or app.config) when it comes to getting EF to work in 2012 with EF 5, it's all the same as 2010. I have both of them on my Win7 machine and I use projects in both with EF successfully. Here's a sample connection string:

    <add name="DataImport" connectionString="metadata=res://*/DataImport.csdl|res://*/DataImport.ssdl|res://*/DataImport.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;data source=asdf;password=asdf;user id=asdf&quot;" providerName="System.Data.EntityClient" />

    I kind of wonder if something in the ODT installer isn't acting correctly when it only finds 2012 on the computer. Could you try setting one up with both 2010 and 2012 and then installing ODT?
  • 6. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    961763 Newbie
    Currently Being Moderated
    @Tridus, thanks for sticking with this. I have tried VS2010. As I said, I have the same problem in VS2012 and VS2010 with the latest ODAC5. I have no problems with ODAC4 and VS2010. I even tried to run ODAC4 together with VS2012, but ODAC4 won't even install if 2012 is the only version of Visual Studio on the same box.

    What does your Update Wizard show for a connection string when you add a table to a model? I would like to compare it with those I have posted in this thread. Thanks.
  • 7. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    Nothing, actually. I just fired up VS, loaded a model, and hit Update Model from Database. It goes directly to the table list (with tables showing) without asking or showing any connection info. I guess it already knows what to connect to. That result looks like this:

    http://www.hiredgoons.ca/oracle/update.PNG

    (Note that in 2012 the tables under Add appear under their schema names, which they don't in 2010. That's what "ENVMSTR" is.)

    If I remove the connection string from the config file to force it to prompt me, I get this:

    http://www.hiredgoons.ca/oracle/update2.PNG (the username there looks a bit weird, but I've also used it with other ones without issues)

    I'm really not sure what I'm doing special to make it work for me and not for you. :\ At this point the only difference I can see is that I used NuGet in VS to install EF 5.

    Edited by: Tridus on Dec 11, 2012 8:49 AM
  • 8. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    961763 Newbie
    Currently Being Moderated
    I suspected the same thing about EF5. I actually tried to install EF5 via NuGet, but I got a console message telling me that EF5 is already installed. I had already installed .NET4.5 and VS2012 clean.
  • 9. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    Was it added to the project though? For example here's the output if I add EF 5 to a new project (if you don't do that, it's using EF 4). In this case it's still adding references and such.

    PM> Install-Package EntityFramework
    'EntityFramework 5.0.0' already installed.
    Successfully added 'EntityFramework 5.0.0' to GNB.ENV.SPAS.Server.Data.OracleDAL.

    Type 'get-help EntityFramework' to see all available Entity Framework commands.
  • 10. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    961763 Newbie
    Currently Being Moderated
    I did as you said and made sure EF5 was included in the project. I confirmed that the EntityFramework DLL was referenced and I note that my web.config was updated. Still no tables.

    I'm still wondering if there are some web.config settings I need to change. Here's a slimmed down version of my web.config after the EF5 reinstall:

    <configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    <connectionStrings>
    <add name="DEVELOPMENT" connectionString="DATA SOURCE=<serverName>;PASSWORD=<pwd>;PERSIST SECURITY INFO=True;USER ID=<userId> providerName="System.Data.EntityClient" />
    </connectionStrings>
    <!--
    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
    <system.Web>
    <httpRuntime targetFramework="4.5" />
    </system.Web>
    -->
    <system.web>
    <compilation debug="true" targetFramework="4.5">
    <assemblies>
    <add assembly="Stimulsoft.Report.Web, Version=2012.3.1500.0, Culture=neutral, PublicKeyToken=EBE6666CBA19647A" />
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </assemblies>
    </compilation>
    </system.web>
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
    <parameter value="v11.0" />
    </parameters>
    </defaultConnectionFactory>
    </entityFramework>
    </configuration>
  • 11. Re: ODP.NET (11.2.0.3.20) breaks EF Update Wizard
    Tridus Journeyer
    Currently Being Moderated
    bflow1 wrote:
    I did as you said and made sure EF5 was included in the project. I confirmed that the EntityFramework DLL was referenced and I note that my web.config was updated. Still no tables.

    I'm still wondering if there are some web.config settings I need to change. Here's a slimmed down version of my web.config after the EF5 reinstall:

    <configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    Mine looks a little bit different, because I'm targetting .net 4.0 and not 4.5.
      <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
    <connectionStrings>
    <add name="DEVELOPMENT" connectionString="DATA SOURCE=<serverName>;PASSWORD=<pwd>;PERSIST SECURITY INFO=True;USER ID=<userId> providerName="System.Data.EntityClient" />
    </connectionStrings>
    This looks a lot different in mine, you're missing a number of the values for an EF connection. (That looks like a normal ADO.net connection)

    {code}
    <add name="DataImport" connectionString="metadata=res://*/DataImport.csdl|res://*/DataImport.ssdl|res://*/DataImport.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;data source=asdf;password=asdf;user id=asdf&quot;" providerName="System.Data.EntityClient" />
    {code}


    So that and the different frameworks are the only differences I'm seeing at this point. Maybe you should open a support ticket with Oracle.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points