Search code examples
c#.net.net-corevisual-studio-codenpgsql

Failed to install Npgsql (Visual Studio Code)


I'm having trouble with installing Npgsql in Visual Studio Code (.Net Core 3.1.1).

I create a clean project and try install package. dotnet new console dotnet add package Npgsql --version 4.1.2

The package fails to install and I receive a message:

The Npgsql package is not compatible with all architectures in the project.. I found a similar problem here, but it was solved by updating NuGet. Which probably won't be my case. What am I doing wrong and how to install the package?


Solution

  • Problem solved. Installing a package using the dotnet add package package-name command does not work for me. But if I install the NuGet Gallery extension (in the VS code) and add a package using this tool, then the library will install properly.