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

前端 未结 9 2345
谎友^
谎友^ 2021-02-12 13:05

This all new to me, so bear with me...

I\'m working on a Visual Studio project; it\'s a web service that returns some data.

I\'ve just tried to make a particula

9条回答
  •  野的像风
    2021-02-12 13:24

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

    \SqlServerTypes
       |_x64
       |_x86
    

    which should contain the appropriate dll's. It's also auto setup to copy if newer.

    Then, make sure your app 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 though.

提交回复
热议问题