MVC3 Entitiy Framework for ASP.NET - In MetadataWorkspace, the EntitySet 'x' mentioned in this MSL does not exist.

asp.net-mvc asp.net-mvc-3 c# edmx entity-framework

Question

I'm developing a system for reservations.

The next question

    Reservatie r = (from res in entities.Reservaties
    where (res.datum == date && res.tijdslot == time)
    select res).FirstOrDefault();

gives me the next error

Error 54 Error 2003: The EntitySet 'Reservaties' specified as part of this MSL does not exist in MetadataWorkspace. ...\www\Models\xxx.edmx

It seems to be having trouble finding my table.

My database is appropriately shown in the edmx file; I've previously worked in that manner multiple times. I looked at the MSL and saw nothing unusual. The issue is that I have no idea where to start looking for the issue.

Could this be related to my integrated N2CMS (dinamico package)? It makes use of nHibernate.

Any ideas on how to begin?

Perhaps the edmx is useful.

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema Namespace="Model.Store" Alias="Self" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.1" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">
        <EntityContainer Name="ModelStoreContainer">
          <EntitySet Name="arrangementen" EntityType="Model.Store.arrangementen" store:Type="Tables" Schema="xxx" />
          <EntitySet Name="complexen" EntityType="Model.Store.complexen" store:Type="Tables" Schema="xxx" />
          <EntitySet Name="klanten" EntityType="Model.Store.klanten" store:Type="Tables" Schema="xxx" />
          <EntitySet Name="reservaties" EntityType="Model.Store.reservaties" store:Type="Tables" Schema="xxx" />
          <EntitySet Name="reservatiestatussen" EntityType="Model.Store.reservatiestatussen" store:Type="Tables" Schema="xxx" />
        </EntityContainer>
        <EntityType Name="arrangementen">
          <Key>
            <PropertyRef Name="arrangementId" />
          </Key>
          <Property Name="arrangementId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="naam" Type="varchar" Nullable="false" MaxLength="255" />
          <Property Name="beschrijving" Type="text" />
          <Property Name="prijs" Type="decimal" Nullable="false" />
          <Property Name="van" Type="int" />
          <Property Name="tot" Type="int" />
          <Property Name="toegelaten_statussen" Type="varchar" Nullable="false" MaxLength="50" />
        </EntityType>
        <EntityType Name="complexen">
          <Key>
            <PropertyRef Name="complexId" />
          </Key>
          <Property Name="complexId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="naam" Type="varchar" Nullable="false" MaxLength="255" />
          <Property Name="openingsuur" Type="int" Nullable="false" />
          <Property Name="sluitingsuur" Type="int" Nullable="false" />
        </EntityType>
        <EntityType Name="klanten">
          <Key>
            <PropertyRef Name="KlantId" />
          </Key>
          <Property Name="KlantId" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="voornaam" Type="varchar" Nullable="false" MaxLength="100" />
          <Property Name="achternaam" Type="varchar" Nullable="false" MaxLength="150" />
          <Property Name="email" Type="varchar" Nullable="false" MaxLength="150" />
        </EntityType>
        <EntityType Name="reservaties">
          <Key>
            <PropertyRef Name="reservatieId" />
          </Key>
          <Property Name="reservatieId" Type="bigint" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="klantId" Type="bigint" Nullable="false" />
          <Property Name="datum" Type="date" Nullable="false" />
          <Property Name="tijdslot" Type="int" Nullable="false" />
          <Property Name="complexId" Type="int" Nullable="false" />
          <Property Name="arrangementId" Type="int" />
          <Property Name="statusId" Type="int" Nullable="false" />
          <Property Name="recurringDaily" Type="bit" />
          <Property Name="recurringWeekly" Type="bit" />
          <Property Name="recurringMonthly" Type="bit" />
          <Property Name="recurringYearly" Type="bit" />
        </EntityType>
        <EntityType Name="reservatiestatussen">
          <Key>
            <PropertyRef Name="statusId" />
          </Key>
          <Property Name="statusId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
          <Property Name="statusnaam" Type="varchar" Nullable="false" MaxLength="255" />
        </EntityType>
      </Schema>
    </edmx:StorageModels>
    <!-- CSDL content -->
    <edmx:ConceptualModels>
      <Schema Namespace="Model" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
        <EntityContainer Name="ALEntities" annotation:LazyLoadingEnabled="true">
          <EntitySet Name="Arrangementen" EntityType="Model.Arrangement" />
          <EntitySet Name="Complexen" EntityType="Model.Complex" />
          <EntitySet Name="Klanten" EntityType="Model.Klant" />
          <EntitySet Name="Reservaties" EntityType="Model.Reservatie" />
          <EntitySet Name="Reservatiestatussen" EntityType="Model.Reservatiestatus" />
        </EntityContainer>
        <EntityType Name="Arrangement">
          <Key>
            <PropertyRef Name="arrangementId" />
          </Key>
          <Property Name="arrangementId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="naam" Type="String" Nullable="false" />
          <Property Name="beschrijving" Type="String" />
          <Property Name="prijs" Type="Decimal" Nullable="false" />
          <Property Name="van" Type="Int32" />
          <Property Name="tot" Type="Int32" />
          <Property Name="toegelaten_statussen" Type="String" Nullable="false" />
        </EntityType>
        <EntityType Name="Complex">
          <Key>
            <PropertyRef Name="complexId" />
          </Key>
          <Property Name="complexId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="naam" Type="String" Nullable="false" />
          <Property Name="openingsuur" Type="Int32" Nullable="false" />
          <Property Name="sluitingsuur" Type="Int32" Nullable="false" />
        </EntityType>
        <EntityType Name="Klant">
          <Key>
            <PropertyRef Name="KlantId" />
          </Key>
          <Property Name="KlantId" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="voornaam" Type="String" Nullable="false" />
          <Property Name="achternaam" Type="String" Nullable="false" />
          <Property Name="email" Type="String" Nullable="false" />
        </EntityType>
        <EntityType Name="Reservatie">
          <Key>
            <PropertyRef Name="reservatieId" />
          </Key>
          <Property Name="reservatieId" Type="Int64" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="klantId" Type="Int64" Nullable="false" />
          <Property Name="datum" Type="DateTime" Nullable="false" />
          <Property Name="tijdslot" Type="Int32" Nullable="false" />
          <Property Name="complexId" Type="Int32" Nullable="false" />
          <Property Name="arrangementId" Type="Int32" />
          <Property Name="statusId" Type="Int32" Nullable="false" />
          <Property Name="recurringDaily" Type="Boolean" />
          <Property Name="recurringWeekly" Type="Boolean" />
          <Property Name="recurringMonthly" Type="Boolean" />
          <Property Name="recurringYearly" Type="Boolean" />
        </EntityType>
        <EntityType Name="Reservatiestatus">
          <Key>
            <PropertyRef Name="statusId" />
          </Key>
          <Property Name="statusId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
          <Property Name="statusnaam" Type="String" Nullable="false" />
        </EntityType>
      </Schema>
    </edmx:ConceptualModels>
    <!-- C-S mapping content -->
    <edmx:Mappings>
      <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs">
        <EntityContainerMapping StorageEntityContainer="ModelStoreContainer" CdmEntityContainer="ALEntities">
          <EntitySetMapping Name="Arrangementen"><EntityTypeMapping TypeName="Model.Arrangement"><MappingFragment StoreEntitySet="arrangementen">
            <ScalarProperty Name="arrangementId" ColumnName="arrangementId" />
            <ScalarProperty Name="naam" ColumnName="naam" />
            <ScalarProperty Name="beschrijving" ColumnName="beschrijving" />
            <ScalarProperty Name="prijs" ColumnName="prijs" />
            <ScalarProperty Name="van" ColumnName="van" />
            <ScalarProperty Name="tot" ColumnName="tot" />
            <ScalarProperty Name="toegelaten_statussen" ColumnName="toegelaten_statussen" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="Complexen"><EntityTypeMapping TypeName="Model.Complex"><MappingFragment StoreEntitySet="complexen">
            <ScalarProperty Name="complexId" ColumnName="complexId" />
            <ScalarProperty Name="naam" ColumnName="naam" />
            <ScalarProperty Name="openingsuur" ColumnName="openingsuur" />
            <ScalarProperty Name="sluitingsuur" ColumnName="sluitingsuur" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="Klanten"><EntityTypeMapping TypeName="Model.Klant"><MappingFragment StoreEntitySet="klanten">
            <ScalarProperty Name="KlantId" ColumnName="KlantId" />
            <ScalarProperty Name="voornaam" ColumnName="voornaam" />
            <ScalarProperty Name="achternaam" ColumnName="achternaam" />
            <ScalarProperty Name="email" ColumnName="email" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="Reservaties"><EntityTypeMapping TypeName="Model.Reservatie"><MappingFragment StoreEntitySet="reservaties">
            <ScalarProperty Name="reservatieId" ColumnName="reservatieId" />
            <ScalarProperty Name="klantId" ColumnName="klantId" />
            <ScalarProperty Name="datum" ColumnName="datum" />
            <ScalarProperty Name="tijdslot" ColumnName="tijdslot" />
            <ScalarProperty Name="complexId" ColumnName="complexId" />
            <ScalarProperty Name="arrangementId" ColumnName="arrangementId" />
            <ScalarProperty Name="statusId" ColumnName="statusId" />
            <ScalarProperty Name="recurringDaily" ColumnName="recurringDaily" />
            <ScalarProperty Name="recurringWeekly" ColumnName="recurringWeekly" />
            <ScalarProperty Name="recurringMonthly" ColumnName="recurringMonthly" />
            <ScalarProperty Name="recurringYearly" ColumnName="recurringYearly" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
          <EntitySetMapping Name="Reservatiestatussen"><EntityTypeMapping TypeName="Model.Reservatiestatus"><MappingFragment StoreEntitySet="reservatiestatussen">
            <ScalarProperty Name="statusId" ColumnName="statusId" />
            <ScalarProperty Name="statusnaam" ColumnName="statusnaam" />
          </MappingFragment></EntityTypeMapping></EntitySetMapping>
        </EntityContainerMapping>
      </Mapping>
    </edmx:Mappings>
  </edmx:Runtime>
  <!-- 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="False" />
        <DesignerProperty Name="IncludeForeignKeysInModel" Value="False" />
      </DesignerInfoPropertySet>
    </Options>
    <!-- Diagram content (shape and connector positions) -->
    <Diagrams>
      <Diagram Name="xxx">
        <EntityTypeShape EntityType="Model.Arrangement" Width="1.5" PointX="0.75" PointY="0.75" Height="2.3648893229166665" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.Complex" Width="1.5" PointX="2.75" PointY="0.75" Height="1.7879850260416674" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.Klant" Width="1.5" PointX="2.75" PointY="3.75" Height="1.787985026041667" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.Reservatie" Width="1.5" PointX="4.75" PointY="0.75" Height="3.1340950520833335" IsExpanded="true" />
        <EntityTypeShape EntityType="Model.Reservatiestatus" Width="1.5" PointX="4.75" PointY="4.75" Height="1.4033821614583317" IsExpanded="true" />
      </Diagram>
    </Diagrams>
  </Designer>
</edmx:Edmx>

The content of the C-S mapping is flagged as being incorrect throughout.

For all of my tables, I also received the message "The EntitySet 'X' mentioned as part of this MSL does not exist in MetadataWorkspace."

I have no idea...

1
3
4/1/2013 4:08:45 PM

Accepted Answer

I neglected to include a reference to the dll for MySql.Data.Entity.

2
9/28/2011 1:22:20 PM

Popular Answer

You should make sure the.EDMX file contains edmx:ConceptualModels> "Schema Namespace" is used........ >, of the Complex type.

It should correspond to TypeName="?????.ComplexTypeName" in the complex type mapping tag.

It fixed my problem...



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow