无法加载System.Threading.Tasks.Extensions [英] Unable to load System.Threading.Tasks.Extensions
问题描述
我有一个基于.net Framework 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:\Workspaces\PS\RConfig\RConfig.cs:line 1113
at RAdmin.Global.Application_Start(Object sender, EventArgs e) in C:\Workspaces\PS\RAdmin\Global.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.
我们非常感谢您的帮助.
Any help is really appreciated.
推荐答案
更新Nuget程序包
https://www.nuget.org/packages/System.Threading.Tasks.Extensions/
将解决您的问题
这篇关于无法加载System.Threading.Tasks.Extensions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!