Failed to load DLL 'SqlServerSpatial140.dll': the specified module was not found

This is all new to me, so carry me ...

I am working on a Visual Studio project; it is a web service that returns some data.

I just tried to make a specific web server call on my local machine (IIS) and I get this error:

Unable to load DLL 'SqlServerSpatial140.dll': the specified module could not be found

Before anyone says this - yes, obviously, I miss this DLL file. I searched the Internet and don’t see where I can download it (I have installed Microsoft SQL Server (x64) and non-X64 CLR types installed. I have Microsoft System CLR types installed for SQL Server 2014 and 2016)

Does anyone know how to fix this? Does anyone know if I can just download this file from somewhere?

+6
source share
2 answers

Copy the dll from C:\Users\<User>\.nuget\packages\Microsoft.SqlServer.Types\14.0.314.76\nativeBinaries\x86 to the project. Right-click on the file and select Properties. Set "Copy to output directory" to "Always copy."

+2
source

When you install the Microsoft.SqlServer.Types nuget package, this should create a new folder in the root:

 \SqlServerTypes |_x64 |_x86 

which should contain the appropriate DLL. It is also an automatic setting for copying if it is newer.

Then make sure your application loads the appropriate assembly:

  • For ASP.NET web applications: SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath("~/bin"));
  • For desktop applications / others: SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);

Not sure if this works with .NET Core.

+4
source

Source: https://habr.com/ru/post/1015566/


All Articles