繁体   English   中英

DbGeography.FromText - 无法加载 DLL 'SqlServerSpatial140.dll':找不到指定的模块。 (来自 HRESULT 的异常:0x8007007E)

[英]DbGeography.FromText - Unable to load DLL 'SqlServerSpatial140.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

在此处输入图像描述

我试图从包文件夹“\packages\Microsoft.SqlServer.Types...\nativeBinaries”中复制 spatial140,在 Visual Studio 中构建成功,没有发现一些错误。

但是在运行项目时,我得到了那个错误。

尝试在web.config中添加绑定重定向。

<runtime>
 <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" />
    <bindingRedirect oldVersion="1.0.0.0-11.0.0.0" newVersion="10.0.0.0" />
  </dependentAssembly>
 </assemblyBinding>
</runtime>

我知道这很糟糕,但我已经解决了问题,必须将 spatial140.dll 复制到 bin 文件夹。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM