New Posts New Posts RSS Feed: metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

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

 Post Reply Post Reply
Author
cseils View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Mar-2011
Location: Australia
Posts: 10
Post Options Post Options   Quote cseils Quote  Post ReplyReply Direct Link To This Post Topic: metadata artifact files (csdl, msl, ssdl) are either invalid or could not be found
    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
Back to Top
cseils View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Mar-2011
Location: Australia
Posts: 10
Post Options Post Options   Quote cseils Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
cseils View Drop Down
Newbie
Newbie
Avatar

Joined: 29-Mar-2011
Location: Australia
Posts: 10
Post Options Post Options   Quote cseils Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down