我使用了带有自定义dll(核心2.2)的v2 azure函数(持久函数),该函数调用服务,但出现以下异常:
I used a v2 azure function (durable function) with custom dll ( core 2.2) that calls a service and I get the following exception:
无法加载文件或程序集'System.Private.ServiceModel, 版本= 4.1.2.4,文化=中性,PublicKeyToken = b03f5f7f11d50a3a'
Could not load file or assembly 'System.Private.ServiceModel, Version=4.1.2.4, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
在调试过程中,我无法进入该方法,并且在不让我进入该方法的情况下引发了异常,并且我不知道到底是什么试图访问该库. 将来自.nuget的程序包手动放入bin文件夹不起作用,奇怪的是,如果使用示例C#函数运行相同的代码,它将起作用.
In the debugging process, I can't step into the method and the exception is thrown without letting me inside it and I don't know exactly what tried to access that library. Putting manually the package from .nuget in the bin folder didn't work and the strange thing is that if a run the same code with a sample C# function it works.
推荐答案此问题在此处详细说明: github/dotnet/wcf/issues/2824
This issue is detailed here: github/dotnet/wcf/issues/2824
我解决的方法是下载nuget System.Private.ServiceModel
How I solved it was to download the nuget System.Private.ServiceModel
并将以下内容添加到我的.csproj
and add the following to my .csproj
<Target Name="CopySPSM" BeforeTargets="Build"> <Copy SourceFiles="$(USERPROFILE)\.nuget\packages\system.private.servicemodel\4.5.3\runtimes\win\lib\netstandard2.0\System.Private.ServiceModel.dll" DestinationFolder="$(OutputPath)\bin" /> </Target>更多推荐
无法在Azure Function v2中加载文件或程序集'System.Private.ServiceModel'
发布评论