I am doing a project which having some functions on Geographical distance calculation. So I use geographical datatypes in entity framework by adding nuget package
SqlServerSpatial110.dll for that function.
I think my code is correct. Everything is working on local server. But when I uploaded it to server it shows the error below:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'SqlServerSpatial110.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
please tell me the steps to upload
SqlServerSpatial110.dll to server.
Add the reference of Microsoft.SqlServer.Types in Web.config of application resolved the issue.
<runtime><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" /> <bindingRedirect oldVersion="126.96.36.199-188.8.131.52" newVersion="10.0.0.0" /> </dependentAssembly> </assemblyBinding></runtime>
Please check to make sure the DLLs are installed on the server:
C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.SqlServer.Types.dll C:\Windows\System32\SqlServerSpatial110.dll
Please check your AppPool. If you are re-using an old AppPool, make sure your AppPool
Advanced Settings -->
Enable 32-Bit Applications is
This fixed my similar problem on a
Windows 2012 Server.
User contributions licensed under CC BY-SA 3.0