Home > Software engineering >  DbGeography.FromText - Unable to load DLL 'SqlServerSpatial140.dll': The specified module
DbGeography.FromText - Unable to load DLL 'SqlServerSpatial140.dll': The specified module

Time:01-27

enter image description here

I have tried to copy spatial140 from packages folder "\packages\Microsoft.SqlServer.Types...\nativeBinaries", in Visual Studio build is a success, not found some error.

But when run the project, I got that error.

CodePudding user response:

Try adding binding redirects in 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>

CodePudding user response:

I know this is bad, but I have solved the issues, must copy spatial140.dll to bin folder.

  •  Tags:  
  • Related