I have a .NET MVC web application referencing System.Data.Spatial
so I can use the DbGeography
datatype on a property for some geolocation stuff. I'm using Visual Studio 2012 with .NET 4.5 and do not have a full installation of SQL Server on my development machine (only localdb).
The app works great until I push it to Azure. As soon as my app hits my DbGeography
property, it throws this error:
Unable to load DLL 'SqlServerSpatial.dll': The specified module could not be found.
Has anyone else encountered this issue?
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
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.
Check off one of these depending on your processor architecture:
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.
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With