MSDN Archive Home
Help and FAQs
All Resource Updates
Change History (all pages)
EdmGen2 is a command-line tool for the Microsoft ADO.NET Entity Framework. The tool can be used as a replacement for the EdmGen.exe tool that ships with the .Net framework 3.5 SP1. EdmGen.exe can only read and write the CSDL, SSDL & MSL file formats. However, EdmGen2.exe can read and write the EDMX file format used by the Visual Studio design tools. Additionally, EdmGen2.exe can translate between EDMX and CSDL, SSDL & MSL formats, and it can be used for code examples in using tooling APIs defined in the System.Data.Entity.Design assembly.
Jun 26 2008 at 9:25 PM
, version 6
Jun 21 2008 at 4:53 PM
I think your description would be clearer if your second sentence read: "It can be used as a replacement for the original EdmGen.exe tool, which ships with the .Net Framework 3.5 and only reads and writes CSDL, SSDL and MSL files (not EDMX files).
Jun 26 2008 at 9:26 PM
Thanks Roger. I updated the description a bit. I hope it is more clear.
Nov 25 2008 at 1:09 PM
You probably want to modify the code so it allows for data provider to report warnings. Don't exit if all you get when generating is EdmSchemaErrorSeverity.Warning. I'm using Npgsql as provider and had to modify your code to skip warnings. This is a great tool, thanks.
May 27 2009 at 7:48 PM
Does not support namespaces, a.k.a. useless! , I have spent 4 hours writing a script, and then found that I cannot use namespaces, so again, what is the point of the tool?
Oct 30 2009 at 3:38 PM
Thanks "void" for the comment. I was stuck at the same problem.
I wrote a method called "HasErrors" for the EdmGen2 class.
private static Boolean HasErrors(IEnumerable<EdmSchemaError> errors)
if (errors == null)
Boolean errorFound = false;
foreach (EdmSchemaError error in errors)
if (error.Severity == EdmSchemaErrorSeverity.Warning) continue;
errorFound = true;
Find line number 150 and add a line "if (HasErrors(ssdlErrors))" before "return" so the result would be:
// write out errors
if ((ssdlErrors != null && ssdlErrors.Count > 0))
System.Console.WriteLine("Error/warning(s) occurred during generation:");
Compile and run and that is IT!
A hint for NPgSQL users by PgFoundry.org. If you got flooded by the warnings as I did (almost 2k lines) at the CMD window, direct the output to a file like this:
edmgen2.exe /ModelGen <connection string> <provider name> <model name> >> output.txt
You will find the "output.txt" from the same directory as the edmgen2.exe with all the content. Also it is faster then writing warnings on the screen.
Aug 5 2013 at 11:30 AM
Doesn't work. Not generate views and XXXModel.Designer.cs
Sign in to add a comment
EdmGen2 (version 1.0.2...
Tue Apr 20 2010 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.