src/Misc/EFTools/EntityDesign/VisualStudio/VsUtils.cs
// <summary>
//     Returns the version of EntityFramework.dll or System.Data.Entity.dll referenced by a project or null if none.
// </summary>
// <remarks>
//     Note that:
//     - the method checks for references to both EntityFramework.dll and System.Data.Entity.dll
//     - the version of EntityFramework.dll wins if references to both EntityFramework.dll and System.Data.Entity.dll are present
//     - the assembly versions are not overlapping so it is possible to distinguish the assembly just by the version
//     - the version of System.Data.Entity.dll assembly will be 4.0.0.0 for both .NET Framework 4 and .NET Framework 4.5
//     but the runtime version should be 5.0.0.0 (EF5) when targeting .NET Framework 4.5 and 4.0.0.0 (EF4) otherwise
// </remarks>
Returns the version of EntityFramework.dll or System.Data.Entity.dll referenced by a project or null if none.
Returns the version of EntityFramework . dll or System . Data . Entity . dll referenced by a project or null if none .
public static Version GetInstalledEntityFrameworkAssemblyVersion(Project project)
        {
            Debug.Assert(project != null, "project is null.");
            return GetInstalledEntityFrameworkAssemblyVersions(project).FirstOrDefault();
        }
public static Version GetInstalledEntityFrameworkAssemblyVersion ( Project project ) { Debug . Assert ( project != null , " " ) ; return GetInstalledEntityFrameworkAssemblyVersions ( project ) . FirstOrDefault ( ) ; }
Returns the version of EntityFramework.dll or System.Data.Entity.dll referenced by a project or null if none.
Returns the version of EntityFramework . dll or System . Data . Entity . dll referenced by a project or null if none .
// EF and SDE references are ordered by version descending and we select the first one
project
Project
remarks
Note that:
the method checks for references to both EntityFramework.dll and System.Data.Entity.dll
the version of EntityFramework.dll wins if references to both EntityFramework.dll and System.Data.Entity.dll are present
the assembly versions are not overlapping so it is possible to distinguish the assembly just by the version
the version of System.Data.Entity.dll assembly will be 4.0.0.0 for both .NET Framework 4 and .NET Framework 4.5
but the runtime version should be 5.0.0.0 (EF5) when targeting .NET Framework 4.5 and 4.0.0.0 (EF4) otherwise
Note that : the method checks for references to both EntityFramework . dll and System . Data . Entity . dll the version of EntityFramework . dll wins if references to both EntityFramework . dll and System . Data . Entity . dll are present the assembly versions are not overlapping so it is possible to distinguish the assembly just by the version the version of System . Data . Entity . dll assembly will be 4 . 0 . 0 . 0 for both . NET Framework 4 and . NET Framework 4 . 5 but the runtime version should be 5 . 0 . 0 . 0 ( EF5 ) when targeting . NET Framework 4 . 5 and 4 . 0 . 0 . 0 ( EF4 ) otherwise