Error when generating Database from Model

Error when generating Database from Model

Postby gbrusella » Wed 11 Dec 2013 20:23

I got a new ADO.Net Entity Model (an .edmx file) and I want to map it to the database.

I left-click the model --> Generate Database from Model..--> Set the connection string using devart's connector and tested OK.

Then I get this error:
Running transformation: System.InvalidOperationException: The SSDL generated by the activity called 'CsdlToSsdlAndMslActivity' is not valid and has the following errors:
No Entity Framework provider found for the ADO.NET provider with invariant name 'Devart.Data.Oracle'. 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.
at Microsoft.Data.Entity.Design.DatabaseGeneration.EdmExtension.CreateAndValidateStoreItemCollection(String ssdl, Version targetFrameworkVersion, IDbDependencyResolver resolver, Boolean catchThrowNamingConflicts)
at Microsoft.VisualStudio.TextTemplating5C130C83565CC2CA4B77356A2D6C966360FD3C3F078C65AB108CDF9939CFADD9BDB14018C350DC3F73B8ABAAB33A7B0960BB2BB2D898F31F5C697F7E73429C2E.GeneratedTextTransformation.get_Store() in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\GenerateTSQL.Utility.ttinclude:line 56
at Microsoft.VisualStudio.TextTemplating5C130C83565CC2CA4B77356A2D6C966360FD3C3F078C65AB108CDF9939CFADD9BDB14018C350DC3F73B8ABAAB33A7B0960BB2BB2D898F31F5C697F7E73429C2E.GeneratedTextTransformation.TransformText() in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\DBGen\SSDLToSQL10.tt:line 86 c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\GenerateTSQL.Utility.ttinclude 56 1


My app.config:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.1.45.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.1.45.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
</configuration>


I'm extracting the model from a MVC Application and mapping it to a new Oracle Database.

Any clue?

Thanks in advance.
gbrusella
 
Posts: 3
Joined: Wed 11 Dec 2013 19:40

Re: Error when generating Database from Model

Postby Shalex » Fri 13 Dec 2013 10:43

Please replace

Code: Select all
Devart.Data.Oracle, Version=8.1.45.6

with

Code: Select all
Devart.Data.Oracle, Version=8.1.45.0

in your app.config.
Shalex
Devart Team
 
Posts: 7531
Joined: Thu 14 Aug 2008 12:44

Re: Error when generating Database from Model

Postby gbrusella » Fri 13 Dec 2013 14:32

Already tried that... And no effect..
gbrusella
 
Posts: 3
Joined: Wed 11 Dec 2013 19:40

Re: Error when generating Database from Model

Postby gbrusella » Fri 13 Dec 2013 15:06

Now I'm trying to cerate a new model, importing an already existent DB.

The app.config:

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <DbProviderFactories>
    <remove invariant="Devart.Data.Oracle" />
    <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.1.45.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </DbProviderFactories>
  <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="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.1.45.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
</configuration>


And get this error:

Image
gbrusella
 
Posts: 3
Joined: Wed 11 Dec 2013 19:40

Re: Error when generating Database from Model

Postby Shalex » Mon 16 Dec 2013 09:35

Your current version of dotConnect for Oracle is 8.1.45, isn't it? If yes, try this app.config:

Code: Select all
    <?xml version="1.0" encoding="utf-8"?>
    <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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
      <DbProviderFactories>
        <remove invariant="Devart.Data.Oracle" />
        <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.1.45.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      </DbProviderFactories>
      <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="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.1.45.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
        </providers>
      </entityFramework>
    </configuration>
Shalex
Devart Team
 
Posts: 7531
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle