I’m developing an application that runs on AutoCAD using .NET Framework 4.8 and Npgsql, following the MVVM pattern. In my project, I use Dependency Injection (DI) to manage the lifecycle of objects through Microsoft.Extensions.DependencyInjection. However, when I use this DI framework, I encounter a conflict and receive the following error: Could not load file or assembly ‘System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral…’
If I remove Microsoft.Extensions.DependencyInjection, the program runs fine. I would like to know if there’s a way to continue using DI in my project while ensuring Npgsql works without issues. I’ve also tried using Autofac for DI, but I encountered a similar error.
I also tried follow this answer but not working
Unable to load System.Threading.Tasks.Extensions
Is there a solution to this problem?
I still want to use Dependency Injection (DI) and Npgsql. Is there a way to use both without causing conflicts or encountering the error Could not load file or assembly ?‘System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral