Generated emdx file wont open in designer mode

Posts   
 
    
kirsten
User
Posts: 5
Joined: 04-Jun-2011
# Posted on: 05-Jun-2011 06:21:05   

Hi I am new to LLBLGen and fairly new to Entity Framework I am using LLBLGen Pro v3.1 to generate a project with Entity Framework The project I created by generated code compiles OK, unfortunately the .EMDX file will only open in XML editor, not the endity data model designer.

I have eddited app.config to have the following connection string

<add name="ConnectionString.SQL Server (SqlClient)" connectionString="metadata=res://*/JtCRM.csdl|res://*/JtCRM.ssdl|res://*/JtCRM.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SATURN3\SQL2008R2;initial catalog=jtCRM;User ID=sa;Password=sapwd;persist security info=False;packet size=4096&quot;" providerName="System.Data.EntityClient" />

Can you suggest what else I should be doing to get the designer working in EF4? Thank you Kirsten

kirsten
User
Posts: 5
Joined: 04-Jun-2011
# Posted on: 05-Jun-2011 07:20:16   

Hi again, I have got it working - but am still wondering why it didnt generate working. To get it working I created another .emdx file in the project , added the tables from the database, so I had a .emdx file that I could open in the designer. Then I replaced the designer part of the XML in the bad emdx file with the code from my freshly created file. Can anyone tell me how to get LLBLGen to generate the good designer section? Or is it not possible because it doesnt know where to display the entities? Thanks Kirsten

BAD CODE

<!-- Designer element for auto-embedding the .edmx file into the compiled assembly as separated resource files and to validate it on build. -->
    <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx">
        <edmx:Connection>
            <DesignerInfoPropertySet>
                <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
            </DesignerInfoPropertySet>
        </edmx:Connection>
        <edmx:Options>
            <DesignerInfoPropertySet>
                <DesignerProperty Name="ValidateOnBuild" Value="true" />
            </DesignerInfoPropertySet>
        </edmx:Options> 
    <!-- __LLBLGENPRO_USER_CODE_REGION_START DesignerCustomCode -->
    <!-- __LLBLGENPRO_USER_CODE_REGION_END -->      
    </edmx:Designer>
</edmx:Edmx>

GOOD CODE
  <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx">
    <Connection>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
      </DesignerInfoPropertySet>
    </Connection>
    <Options>
      <DesignerInfoPropertySet>
        <DesignerProperty Name="ValidateOnBuild" Value="true" />
        <DesignerProperty Name="EnablePluralization" Value="True" />
        <DesignerProperty Name="IncludeForeignKeysInModel" Value="True" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="jtCRM">
        <EntityTypeShape EntityType="jtCRMModel.Contact" Width="1.5" PointX="0.75" PointY="1.375" Height="1.5923063151041672" IsExpanded="true" />
        <EntityTypeShape EntityType="jtCRMModel.Entity" Width="1.5" PointX="0.75" PointY="5.5" Height="1.4279589843749996" IsExpanded="true" />
        <EntityTypeShape EntityType="jtCRMModel.Link" Width="1.5" PointX="3" PointY="1" Height="2.4140429687499996" IsExpanded="true" />
        <AssociationConnector Association="jtCRMModel.FK_500dd4046cc8e002e2632300907" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="2.1711531575520837" />
          <ConnectorPoint PointX="3" PointY="2.1711531575520837" />
        </AssociationConnector>
        <AssociationConnector Association="jtCRMModel.FK_2cdd2b44b16a0c27608a0dd2cc6" ManuallyRouted="false">
          <ConnectorPoint PointX="2.25" PointY="6.2139794921875" />
          <ConnectorPoint PointX="3.75" PointY="6.2139794921875" />
          <ConnectorPoint PointX="3.75" PointY="3.4140429687499996" />
        </AssociationConnector>
      </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Jun-2011 05:18:04   

Why would you like to open the file in EF Designer? All you need to do is to open LLBLGen Desinger, make all wanted changes and re-generate code. One of the main ideas behind LLBLGen v3.x is that you don't need to open other designers.

David Elizondo | LLBLGen Support Team
kirsten
User
Posts: 5
Joined: 04-Jun-2011
# Posted on: 06-Jun-2011 21:37:43   

I just wanted to explore the generated code. I guess I can live with it.