Entity Framework cannot update database

前端 未结 5 2010
小蘑菇
小蘑菇 2020-12-08 06:54

My application crashes with the following error whenever I save to the DB.

Unable to find an entry point named \'SetClrFeatureSwitchMap\' in DLL \'Sql

5条回答
  •  无人及你
    2020-12-08 07:28

    I know I am late to the party, but I had the same problem with MSSQL 2012 and it was really annoying. I was not able to run any query in tables with Spacial column(s). It was a bit tricky. I summarize my approach, just in case for others,

    The reason is because of some inconsistency between SP3 and CLR. The best way to that is checking C:\Windows\assembly and if you see some Microsoft.SqlServer.Types here you need to remove and install them again. Well removing them is a bit tricky:

    1. Possibly uninstall all SQL server updates from windows update, I just did this for Service packs 1,2,3

    2. Go to this location in registery HKLM\SOFTWARE\Classes\Installer\Assemblies\Global here

    3. Delete all keys with the name Microsoft.SqlServer.Types, but before that take a registry backup Be careful not to mess up the registry.

    4. Run Developer Command Prompt as Administrator and run this command gacutil -i Microsoft.SqlServer.Types

    5. Repair the original version of SQL server you already have.

    Finally, I was able to execute any query on any table even with Geometry (Spatial) data.

    Hope this helps some people.

提交回复
热议问题