System.DllNotFoundException:无法加载DLL'SqlServerSpatial110.dll':找不到指定的模块 [英] System.DllNotFoundException: Unable to load DLL 'SqlServerSpatial110.dll': The specified module could not be found
问题描述
我正在做一个在地理距离计算上具有某些功能的项目。因此,我在实体框架中使用地理数据类型,为此功能添加了nuget包 SqlServerSpatial110.dll
。
I am doing a project which having some functions on Geographical distance calculation. So I use geographical datatypes in entity framework by adding nuget package SqlServerSpatial110.dll
for that function.
我认为代码正确。一切都在本地服务器上工作。但是,当我将其上传到服务器时,它显示以下错误:
I think my code is correct. Everything is working on local server. But when I uploaded it to server it shows the error below:
System.Reflection.TargetInvocationException:异常已由目标服务器抛出。调用。 ---> System.DllNotFoundException:无法加载DLL SqlServerSpatial110.dll:找不到指定的模块。 (来自HRESULT的异常:0x8007007E)
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'SqlServerSpatial110.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
请告诉我上传 SqlServerSpatial110.dll $ c的步骤$ c>到服务器。
please tell me the steps to upload SqlServerSpatial110.dll
to server.
推荐答案
在应用程序的Web.config中添加Microsoft.SqlServer.Types的引用解决了该问题。
Add the reference of Microsoft.SqlServer.Types in Web.config of application resolved the issue.
<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>
这篇关于System.DllNotFoundException:无法加载DLL'SqlServerSpatial110.dll':找不到指定的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!