Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix - Unable to load DLL 'SqlServerSpatial110.dll' error

I have an ASP.NET MVC WebApp with an attached remote SQL database where I am getting above error regarding SqlServerSpatial110.dll when the VS solution is started from localhost.

So far I was not even aware that this DLL is used by my app and I have no references in the solution that point to it.

  • the solution was running without error so far (locally and remote) - the error first appeared after some HTML changes (no reference changes/additions made). Important: I had 2 different solutions open with VS at that moment. One solution opened as admin and the other as regular user.
  • running the solution in debug mode gives no error
  • I also restored the PC system to a previous point where the solution previously was running correctly, but that did not remove the error
  • I searched for SqlServerSpatial110.dll on my PC and found it at 2 locations (C:\Windows\System32 and C:\Program Files\Microsoft SQL Server\110\LocalDB\Binn) but not in the solution folders
  • Windows 10, 64 Bit. Visual Studio 2019

Edit: I added an entry to the Web.config as suggested here

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
    <bindingRedirect oldVersion="1.0.0.0-11.0.0.0" newVersion="10.0.0.0" />
  </dependentAssembly>  

and the error vanished. However, I don't understand why this is needed all of a sudden, since previously the solution was working without error and no relevant changes were made.

Any help to pin down the problem or how to proceed would be appreciated.

like image 511
Manu Avatar asked Oct 21 '25 03:10

Manu


1 Answers

This error may occur due to some modules missing while installing the SQL server.

Download and Install the SQL feature pack, choose SQLSysClrTypes.msi while installing the feature pack. ‘SQLSysClrTypes.msi’ contains the SQL CLR Types library with ‘SqlServerSpatial110.dll’.

---------- OR----------

The following NuGet command can solve your issue, please take a backup before executing the NuGet command

Install-Package Microsoft.SqlServer.Types

Hope this will help

like image 128
Dip Surani Avatar answered Oct 23 '25 16:10

Dip Surani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!