Print Page | Close Window

metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2937
Printed Date: 13-May-2026 at 9:25pm


Topic: metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found
Posted By: cseils
Subject: metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found
Date Posted: 28-Aug-2011 at 8:39pm
Hello,

I originally had multiple assemblies with different edmx files which were mapping to one database.
To keep the EDMX files from becoming too large, I split them into seperate assemblies.
This all worked fine.  I had the following in the web config

<connectionStrings>
  <add name="SecurityEntities" connectionString="metadata=res://*/SecurityModel.csdl|res://*/SecurityModel.ssdl|res://*/SecurityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;removed&quot;" providerName="System.Data.EntityClient" />
  <add name="ProductsEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;removed&quot;" providerName="System.Data.EntityClient" />
  <add name="CustomersEntities" connectionString="metadata=res://*/CustomersModel.csdl|res://*/CustomersModel.ssdl|res://*/CustomersModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;removed&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

All the connection strings pointed to the same database, and each domain model had the correct connection string.

Because VS 2010 takes forever to compile when there are a large number of projects, I decided to merge all the EDMX files into their own assembly called DomainModel.
All edmx files were in their own directory and the Namespace was identical as before.
I then modified the connectionstrings in the webconfig to point to the new resource so SecurityModel.csdl became
Security.SecurityModel.csdl, SecurityModel.ssdl became Security.SecurityModel.ssdl etc, to cater for the new metadata artifact resources in the DomainModel.

However, I am now getting the error on the server:

The model's metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found, either as resources in an assembly or loose in the output directory.  Perhaps you have multiple assemblies containing the same metadata. Check the connection string for key 'SecurityEntities', which says the artifact filenames are Security.SecurityModel.csdl, Security.SecurityModel.ssdl, and Security.SecurityModel.msl. Do these names match the actual artifact filenames? All three root names (e.g., 'Security.SecurityModel') should be the same and match the edmx filename unless you changed them deliberately.

I have checked the resources using reflector in the DomainModel assembly and metadata artifact files are exactly as specified.  I have also made sure there are no old assemblies still lurking around.

Do you have any pointers to try to try and fix this problem?

Thanks
Chris



Replies:
Posted By: cseils
Date Posted: 28-Aug-2011 at 11:58pm
Further to this, the inner exception is as follows:

Schema specified is not valid. Errors: 
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Person'. Previously found CLR type 'DomainModel.Ordering.Person', newly found CLR type 'DomainModel.Mailer.Person'.
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Person'. Previously found CLR type 'DomainModel.Ordering.Person', newly found CLR type 'DomainModel.Companies.Person'.
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Person'. Previously found CLR type 'DomainModel.Ordering.Person', newly found CLR type 'DomainModel.Customers.Person'.
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Person'. Previously found CLR type 'DomainModel.Ordering.Person', newly found CLR type 'DomainModel.Security.Person'.
The mapping of CLR type to EDM type is ambiguous because multiple CLR types match the EDM type 'Person'. Previously found CLR type 'DomainModel.Ordering.Person', newly found CLR type 'DomainModel.Products.Person'.


I do have the same table mapped in multiple EDMX files in the same assembly.  They are all in different namespaces (ie different directories).

Is there a workaround for this, as I have to have this same table in all the Domain models.
Thanks
Chris


Posted By: cseils
Date Posted: 29-Aug-2011 at 6:23pm
I have resolved this by just moving everything into one entity model.  Not the best solution but it works



Print Page | Close Window