Print version of EntityFramework at runtime

Is there a way to get the version of EF at runtime? Something like

Console.WriteLine(Environment.Version); 

will return

 4.0.30319.18034 
+4
source share
2 answers

Extension of Alexey’s idea, you can do

 string version = typeof(DbSet).Assembly.GetName().Version.ToString(); 
+3
source

Print the "version" of the assembly for any type of structure you are interested in:

 Console.Write( typeof(String).Assembly.GetName().Version); 
+1
source

All Articles