Check the .Net versions of all your projects in the solution explorer. In my case, it was .Net 6.0.1 in 2 projects and .Net 6.2.0 in the 3rd project so I changed the version of the third project and it worked. To do so: Right click the solution name in solution explorer.Select 'Manage Nuget Packages... Continue Reading →