11

I'm trying to get the nuget package Microsoft.SqlServer.Types to work in ASP Core targeting full framework 461. I need to use the types SqlGeography and SqlHierarchyId. But when I run my test I get following error 'Unable to load DLL SqlServerSpatial140.dll'. I know when the package is installed the dlls file can be found in the .nuget\packages\microsoft.sqlserver.types\14.0.314.76\nativeBinaries\ folder.

But how do I include the dlls in my solution the best way?

I would like the dlls to be updated when the package is updated. The path can not be hardcode to a specific user path, it has to work on every pc setup.

1

1 Answer 1

1

There is a readme.htm file included with the Microsoft.SqlServer.Types Nuget package. It will explain how to load the needed native dll files. Basically you need to call this line in your code:

SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.