0

Possible Duplicate:
How to get current EF version

In my windows forms application, I want to display the Entity Framework version being used by the applications .edmx files. Is it possible to get the Entity Framework version from the app.config file or the .edmx file in C#?.

Community
  • 1
  • 1
StackTrace
  • 9,190
  • 36
  • 114
  • 202

2 Answers2

2

You can get it like this:

Assembly assembly = Assembly.LoadFrom("System.Data.Entity.dll");
Version ver = assembly.GetName().Version;
Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
1

The EDMX file version isn't related to Entity Framework version, although there's a version. Probably best is to simply check the version of EntityFramework.dll (assuming you're using more or less current version(s)) that's loaded in your application. I.e. AppDomain.CurrentDomain.GetAssemblies might be helpful.

Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
cincura.net
  • 4,130
  • 16
  • 40