SQL 2012 SP3 and entity framework conflict

An issue with SQL Server 2012 SP3 was identified that impacted EF4/5 due to additional datatypes in the dll.

System.EntryPointNotFoundException: Unable to find an entry point named 'SetClrFeatureSwitchMap' in DLL 'SqlServerSpatial110.dll'

To easily identify the available dll versions of sql server, I ran a quick adhoc bat file.

The output returns a simple text file like this:

/images/SNAG-0035_pucmdd.jpg
A post in technet mentioned that the DLL shipped with SP3 could cause these conflicts and if the uninstall didn’t clean up the GAC correctly, problems could occur with Entity Framework calls.

Can confirm in my case it was due to dll shipped in SQL Server SP3. I had to uninstall the patch but the newer dll was still in the gac so I had to overwrite with the older version using gacutil. ( Edited by snowcow Thursday, January 14, 2016 12:41 PM )

The Fix

In my case, I still needed the current SP3 version, but we wanted to make sure that the app was pointing to the older version to avoid this error. I apparently needed to point backwards to: C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types\10.0.0.0__89845dcd8080cc91 Stack Overflow, the golden mecca of programming knowledge, saved the day with a solid answer

EF Cannot Update Database This forces the EntityFramework to use the version 10 of the SqlServer.Types.dll, which doesn’t have the Geometry type apparently. - KdBoer When the fix was applied to map the application config to the older version of the Microsoft.SqlServer.Types.dll (in this case 10). Apparently the 2012 SP3 provided some additional functionality in the dll and this had a conflict with Entity Framework 4 for my situation (and according to online posts EF5 also had some issues)


Webmentions

(No webmentions yet.)