Question

Presently we use Visual Studio 2012, EF 5.0 and Npgsql 2.0.12.0.

I'd like to upgrade to Visual Studio 2013 and Npgsql 2.0.14.3 (I'm fine with EF 5.0 for now).

Presently we use the "Update Model" wizard which takes any changes in the schema and feeds them into the edmx file which is viewed in the VS designer. We do this by following the awkward procedure of using DDEX in Npgsql.Provider2 and starting the "experimental" Visual Studio instance.

But this no longer works in Visual Studio 2013 (after updating the generated registry entries). Also it does not work if I change he DbProvider to Npgsql 2.0.14.3 in machine.config.

It would be outstanding if someone could tell me if they got this to work and how.

As a temporary alternative, I'm considering updating the edmx file from the schema by using edmgen.exe. So far, I've been able to generate the .csdl, .ssdl and .mdl files, but I can't find a way to package all of them into a .edmx file. Has anyone tried this approach?

Was it helpful?

Solution

The EF Designer needs a DDEX provider to be able to work. Looks like originally the DDEX provider was only installed in your experimental version of VS2012. When you install VS2013 you don't have the registry keys for the DDEX provider and the EF Designer cannot work with your database.

Edmx is just gluing together csdl msl and ssdl. Assuming you are using v3 schemas (i.e. your csdl is in this namespace: xmlns="http://schemas.microsoft.com/ado/2009/11/edm") you can just paste the contents of the files in this template (I added comments which file should be pasted where):

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
        <!-- paste SSDL contents here -->
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
        <!-- paste CSDL contents here -->
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
        <!-- paste MSL contents here -->
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
    <edmx:Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </edmx:Connection>
    <edmx:Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
        <DesignerProperty Name="EnablePluralization" Value="True" />
        <DesignerProperty Name="CodeGenerationStrategy" Value="None" />
      </DesignerInfoPropertySet>
    </edmx:Options>
    <!-- Diagram content (shape and connector positions) -->
    <edmx:Diagrams>
    </edmx:Diagrams>
  </edmx:Designer>
</edmx:Edmx>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top