Felipe Centeno
Felipe Centeno

Reputation: 3787

Publish option is gone from context menu in VS2017

So I'm trying to publish a project, but for whatever reason I can't. The very last project that I added still gives me the option to do it, but none of the other projects allow me to do it. The publish option is missing from the context menu (see snippets). I tried to change the guid as explained in this article, but no luck.

Publish

No publish

How do I publish my projects??

Thanks for the help in advance!

By the way I'm using Visual Studio Community 2017

Upvotes: 5

Views: 7503

Answers (4)

I solved this by updating the .vbproj file. I had to add the Project Type Guids to the "PropertyGroup" tag. <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>.
In this case GUID 349c5851-65df-11da-9384-00065b846f21 is for ASP.NET MVC 5 and F184B08F-C81C-45F6-A57F-5ABD9991F28F for VB.NET. Have a look at GitHub List of GUIDS. Multiple Guids can be added, separated by a semicolon.

Upvotes: 0

Arnav Gupta
Arnav Gupta

Reputation: 9

I dont know why is there this problem but when I created a new project which had an extra ".NET" in brackets, it solved the problem.

Upvotes: 0

Muni Chittem
Muni Chittem

Reputation: 1146

I fixed this issues by using VS installer ,selected web development options and installed it. After installing web development settings I can publish option.

Upvotes: 3

Felipe Centeno
Felipe Centeno

Reputation: 3787

So I haven't been able to figure out why the menu is missing, but I found a way to publish it via the command line which ends up being the same. Using a cmd with admin rights navigate to the project you want to publish and use these commands:

set Platform=
set ASPNETCORE_ENVIRONMENT=
dotnet publish -c Release -o bin\Release\PublishOutput

-c specifies the configuration {Debug|Release}, and -o the relative output location. For more info go to the documentation of dotnet

Upvotes: 3

Related Questions