Azure functions runtime exception, the type initializer for system data sqlclient excetion, Unable to load DLL 'sni.dll'

前端 未结 2 1084
清酒与你
清酒与你 2021-01-21 13:14

I am using aspnet core 3.0 and azure function v3-preview with system.data.sqlclient version 4.7.0 When i try to run azure function(on both service queue trigger

相关标签:
2条回答
  • 2021-01-21 13:40

    It worked for me by adding below code in csproj file :

    
    <Target Name="PostPublish" BeforeTargets="Publish">
      <Exec Command="move $(PublishDir)\runtimes $(PublishDir)\bin" />
    </Target>
    

    This line should be taking care of that: <Exec Command="move $(PublishDir)\runtimes $(PublishDir)\bin" />

    reference : github

    0 讨论(0)
  • 2021-01-21 13:45

    Please make sure your azure function meet these criteria in this link.

    And here is a workaround provided by others, add the following to your .csproj:

    <Target Name="PostBuild" AfterTargets="PostBuildEvent">
        <Exec Command="copy $(OutDir)$(ProjectName).deps.json $(OutDir)bin\function.deps.json" />
      </Target>
      <Target Name="PostPublish" BeforeTargets="Publish">
        <Exec Command="copy $(PublishDir)$(ProjectName).deps.json $(PublishDir)bin\function.deps.json" />
      </Target>
    
    0 讨论(0)
提交回复
热议问题