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.
SqlServer. Types. dll from its location in C:\Windows\assembly\GAC_MSIL.
SQL Server services, tools and editions Also bundled with the DBMS are two sets of tools for DBAs and developers: SQL Server Data Tools, for use in developing databases, and SQL Server Management Studio, for use in deploying, monitoring and managing databases.
SQL Server is the most popular database when talking about ASP.NET Core since it's what Microsoft is also selling and also the first one that Entity Framework Core is developed for.
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);
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