EdmGen2 is a nice tool. Especially if you know EdmGen you may find it useful. I.e. you may speed up the start of you application by pregenerating views directly from EDMX file.
Unfortunately if you try to use it with EFv4 it will crash. But we have sources, why not to fix the problem? And that’s what I did.
First problem was with new namespaces the EFv4 EDMX file has. The new ones are:
static string csdlNamespace = "http://schemas.microsoft.com/ado/2008/09/edm"; static string ssdlNamespace = "http://schemas.microsoft.com/ado/2009/02/edm/ssdl"; static string mslNamespace = "http://schemas.microsoft.com/ado/2008/09/mapping/cs";
The next step is to switch the project to target .NET Framework 4, you can do it in project options. And finally check whether the references, especially System.Data.Entity.Design, where the interesting objects are, are pointing to “188.8.131.52 versions” and correct if needed.
Done. Build and use. And if you want to have it without work, grab this file with all changes already done ;).