What is the purpose of .edmx files?

Anuj Aggarwal picture Anuj Aggarwal · Feb 9, 2011 · Viewed 60.3k times · Source

What is the purpose of .edmx files? Reading the CSDL, SSDL, and MSL specifications, it looks to me like .edmx files are used only at design time. Are we meant to distribute it with the other edmx? It seems like we need to distribute the .ssdl and/or .csdl files instead.

Answer

marc_s picture marc_s · Feb 9, 2011

EDMX is Visual Studio's "container" for all things about your Entity Data Model.

It contains all the information that is in the CSDL, SSDL, MSL, plus information about the visual layout of the tables in your Visual Studio designer surface.

The EDMX file is converted into CSDL, SSDL, MSL (typically embedded as resources in your assembly) during the build process. You definitely don't have to distribute or copy the EDMX files anywhere for the app to run.

Update: if you are more interested in a code-based approach, you should check out the code-first CTP for Entity Framework which gets by without any .edmx, .csdl/ssdl/msl files at all.