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

383 Views Asked by At

I am getting this message when I executed the dotnet publish command on cmd.

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

dotnet publish "/p:PublishProfile=Properties\PublishProfiles\PMIAdmin.pubxml"

enter image description here

It is working when I clicked the publish button on Visual Studio 2019

enter image description here

How can I publish this project from cmd?

dotnet version: .NET Framework 4.5 project type: Asp.Net MVC

1

There are 1 best solutions below

0
Guru Stron On BEST ANSWER

dotnet publish is for .NET Core, to publish .NET Framework app you can use MSBuild directly. For example from Visual Studio Developer Command Prompt:

msbuild path_to_sln_file /p:DeployOnBuild=true /p:PublishProfile=<profile-name>

Read more.