Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity framework - create the csdl, ssdl and msl files

I work with EF 4 (not with Self-tracking entities currently). I've added some columns (non of them is a key and all of the are nullable) to one of my entities, and got the Number of members in conceptual type does not match with number of members on object side type exception.
I've followed the accepted answer here but all I got from that was that this entity does not appear in my edmx anymore. I've re-added it from DB, but I keep getting the same exception.
I think the problem is that I've copied the csdl/ssdl/msl files to my executing assembly directory. I'd like to copy the updated files, but they're not created again (they were once created in the obj\Debug\edmxResourcesToEmbed folder of my EF project), not even after removing them.
Any way to get those files created again?
Thanks.

P.S: As I don't want to publish excess amounts of code, I don't add anything yet but I'll be happy to add needed information, I'm just not sure what exactly is needed.

like image 942
Noich Avatar asked Aug 23 '11 08:08

Noich


People also ask

What is CSDL SSDL and MSL in Entity Framework?

CSDL (Conceptual Schema definition language) is the conceptual abstraction which is exposed to the application. SSDL (Storage schema definition language) defines the mapping with your RDBMS data structure. MSL ( Mapping Schema language ) connects the CSDL and SSDL. CSDL, SSDL and MSL are actually XML files.

What is Ssdl Entity Framework?

Store schema definition language (SSDL) is an XML-based language that describes the storage model of an Entity Framework application. In an Entity Framework application, storage model metadata is loaded from a . ssdl file (written in SSDL) into an instance of the System.

What is MSL in asp net?

Mapping (MSL : Mapping Schema Language)


1 Answers

So if you want to create the csdl, ssdl amd msl files, do the following:

  1. Go to your edmx file.
  2. Click on the GuI screen that shows the model.
  3. Switch to the property window (I didn't know that it needs to be accessed from the GUI area and not by right clicking the file in the Solution Explorer.
  4. In the Metadata Artifact Process select Embed in Output Assembly.

Done and done, the files will appear in Debug\edmxResourcesToEmbed under obj or obj\x86, depends on your build definitions.
I'm sorry if this seems to simple to explain, but I was in need for those instructions (msdn was not a great help) and I hope it might help others.

like image 79
Noich Avatar answered Sep 27 '22 19:09

Noich