Unable to load System.Threading.Tasks.Extensions(无法加载 System.Threading.Tasks.Extensions)
问题描述
我有一个基于 .net 框架 4.5.1 的 Web 项目.我们正在尝试为该项目添加 PostgreSQL 支持.使用 Nuget,我已将 4.0.4 npgsql 安装到项目中.在引用下,我看到以下内容被添加到项目中.
I have a web project build on .net framework 4.5.1. We are trying to added PostgreSQL support for the project. Using Nuget, I have installed 4.0.4 npgsql to the project. Under references, I see the following being added to the project.
- Npgsql - 4.0.4.0 - 运行时版本 v4.0.30319
- System.Threading.Tasks.Extensions - 4.2.0.0 - 运行时版本 v4.0.30319
当我尝试运行项目并连接并从数据库中获取数据时,我收到以下错误提示 FileNotFoundException:
When I tried run the project and connect and get the data from the database, I am getting the following error saying FileNotFoundException:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'com.rsol.RConfig' threw an exception.
Source=RConfig
StackTrace:
at com.rsol.RConfig.getInstance() in C:WorkspacesPSRConfigRConfig.cs:line 1113
at RAdmin.Global.Application_Start(Object sender, EventArgs e) in C:WorkspacesPSRAdminGlobal.asax.cs:line 528
Inner Exception 1:
TypeInitializationException: The type initializer for 'com.rsol.Db.DbMgr' threw an exception.
Inner Exception 2:
FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Inner Exception 3:
FileNotFoundException: Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
使用 Nuget 安装的 System.Threading.Tasks.Extensions 未加载到项目中.当我检查 System.Threading.Tasks.Extensions 引用的属性时,该 dll 文件存在于该位置.我还尝试使用 gacutil 将 System.Threading.Tasks.Extensions.dll 文件安装到程序集.我仍然遇到同样的错误.
System.Threading.Tasks.Extensions which is installed using Nuget is not getting loaded to the project. When I checked the properties of System.Threading.Tasks.Extensions reference, the dll file exists in the location. I have also tried installing System.Threading.Tasks.Extensions.dll file to assembly using gacutil. I am still getting the same error.
如果您需要任何其他信息,请告诉我.
Please let me know if you need any additional information.
非常感谢任何帮助.
推荐答案
更新 Nuget 包
https://www.nuget.org/packages/System.Threading.Tasks.Extensions/
会解决你的问题
这篇关于无法加载 System.Threading.Tasks.Extensions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法加载 System.Threading.Tasks.Extensions
基础教程推荐
- c# Math.Sqrt 实现 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01