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."
Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
msbuild -t:Restore will restore nuget packages for projects with PackageReference nuget management format.
The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file. In most cases, you don't need to explicitly use the dotnet restore command, since a NuGet restore is run implicitly if necessary when you run the following commands: dotnet new.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With