Unable to load DLL 'SqlServerSpatial.dll'
SqlServerSpatial.dll is unmanaged code. You have to install the correct version (64bit) on the server. Add the DLL to your project. Set the properties of SqlServerSpatial110.dll to “Copy to Output directory = Copy always”
You find detailed Information here
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.SqlServer.Types"
publicKeyToken="89845dcd8080cc91" culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
SQL 2012 installs this dll too, SQL 2014 don't! You have to install the Microsoft System CLR Types for SQL Server 2008 R2 on the machine.
- http://www.microsoft.com/en-us/download/details.aspx?id=26728
- Click Download
Check off one of these depending on your processor architecture:
- 1033\x64\SQLSysClrTypes.msi
- 1033\x86\SQLSysClrTypes.msi
- 1033\IA64\SQLSysClrTypes.msi
Click Next
Edit
as Ian Grainger
's comment, you have to install the correct version based on your IIS. apparently IIS Express runs in 32bit mode by default.
I ran into this problem and was truly missing the SqlServerSpatial110.dll
I ended up following the instructions here:
http://dllyes.com/sqlserverspatial110-dll/
Basically you need to get your hands on that .dll and then
Place SqlServerSpatial110.dll in \Windows\System32 (usually located at disk C) if you’re running 32 bit Windows. If you’are running 64 bit Windows, additionally place file in \Windows\SysWOW64.