Nothing to do. None of the projects specified contain packages to restore

Suleman Mehmood picture Suleman Mehmood · Sep 5, 2019 · Viewed 8.4k times · Source

I have a web app in dot net along with other projects. when i open the .sln file and publish the web project, it does. But, when I try to publish the web proj using command line and .csproj, it gives an error. "Nothing to do. None of the projects specified contain packages to restore."

Answer

Lars Pellarin picture Lars Pellarin · Feb 17, 2021

I got this after converting my csproj to vs2019 format and running dotnet test. The solution was to ensure i had the right test adapter and framework. My csproj files had both the old Microsoft.VisualStudio.QualityTools.UnitTestFramework reference and the new MSTest.TestAdapter + MSTest.TestFramework + Microsoft.NET.Test.Sdk. I kept the new ones and my tests were run.