Unable to load DLL ‘SqlServerSpatial140.dll’: The specified module could not be found

For those who are seeing a very similar set of errors, something like:

Could not copy the file “…\SqlServerTypes\x64\SqlServerSpatial140.dll”
because it was not found

If you installed Microsoft.SqlServer.Types via NuGet and your application works locally but you get errors when building via Azure DevOps then you simply need to add the dlls to source control. As @Pure.Krome noted, these dlls exist locally at:

enter image description here

However, notice that by default these dlls are ignored (red icon at left). Right-click the ignored dlls and select Add Ignored File to Source Control… then commit and push your changes, then queue a new build! Note: Your solution may contain several projects, and each may have their own SqlServerTypes folder.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)