Azure Function .NET Framework 4.7.2 无法加载 System.Threading.Tasks.Extensions 4.2.0.0
我有一个包含 Azure Function 项目和类库的解决方案。 当我尝试在函数项目中使用类库时,出现错误
Unable to load System.Threading.Tasks.Extensions 4.2.0.0
两个项目都安装了 System.Threading.Tasks.Extensions 4.5.4 NuGet 包。 在这里我发现了一个重定向程序集版本的方法。这是类库项目的 xxx.csproj 文件
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
这是功能项目的 xxxx.csproj (System.Threading.Tasks.Extensions 4.5.4)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.6.0" />
<PackageReference Include="AzureFunctions.Autofac" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
...
</Project>
如何解决功能项目中的问题?
I have a solution containing a Azure Function project and a class library.
When I try to use the class library in a function project I get an error
Unable to load System.Threading.Tasks.Extensions 4.2.0.0
Both projects have the System.Threading.Tasks.Extensions 4.5.4 NuGet package installed.
Here I found a way to redirect assembly versions. Here is xxx.csproj file of class library project
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
Here is xxxx.csproj of function project (System.Threading.Tasks.Extensions 4.5.4)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.6.0" />
<PackageReference Include="AzureFunctions.Autofac" Version="2.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>
...
</Project>
How to fix a problem in a feature project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
System.Threading.Tasks.Extensions
与
System.Threading.Tasks.Extensions
with