Share via


New VS 2019 on Windows 10 installation has no "Build" menu item and Build buttons are grayed out.

Question

Saturday, October 26, 2019 11:26 AM

I have a subscription to Professional VS 2017.

I have installed VS 2019 on a new Windows 10 PC.

I wish to build an existing .NET C# project, which builds correctly on VS 2017 on a Windows 7 machine.

One of the items chosen for the VS 2019 install was .NET with C#.

Problem: the Build menu item is absent from the task bar.

Note: these are NOT the "build definition" buttons, but the Build button used to start a build of the loaded project. The equivalent shortcut key would be "F7", which in this case is ignored.

If I assign the Build toolbar to appear, the Build buttons on the toolbar are grayed out.

I executed a "Tools > Import Settings > Reset all Settings" with a selection of "Reset to C#".

This did not help.

I then uninstalled VS 2019, and installed VS 2017, which has been running successfully on the afore-mentioned Windows 7 PC.

I had the same problem there.

I imported the VS 2017 settings from the Windows 7 PC and that did not resolve the issue.

Your help is appreciated.

GCB

Toronto,

Ontario, Canada

All replies (8)

Tuesday, October 29, 2019 2:20 PM ✅Answered

It turns out the .csproj file was not missing. 

My solution:

Instead of opening the Solution file, I navigated to one of the two Project sub-folders and opened that Project file instead.

VS then opened the entire solution correctly. It then asked me to install .NET 3.5 and after that I was able to build the project.

I did not have to "Set as Startup Item".

Thanks for the help guys.

Gerald Christian


Monday, October 28, 2019 7:46 AM

Hi Gerald Christian,

Sorry for delay in reply.

According to your description, could you select the project then press "CTRL + B" or right-click the project in solution explorer to build your project in visual studio? and you could try to open developer command prompt for visual studio 2017, then type below command:

msbuild [Project Directiry]Or[Solution Directory]

If it persists, please open visual studio installer and check if these components has been installed.

If possible, could you share some screenshots to help us analysis this issue?

Look forward to your feedback.

Best Regards,

Dylan

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]


Monday, October 28, 2019 8:40 AM

Hi

Check in solution explorer that you have a project set as startup project. Right click on the project and select "Set as StartUp Project". This has been the cause of the same issue for me previously.

Hope it helps.


Monday, October 28, 2019 2:03 PM

Hi Dylan,

I checked the installer as you mentioned I do have those items installed:

.NET desktop development

Included
.NET desktop development tools
.NET Framework 4.6.1 development tools
C# and Visual Basic

Optional
.NET Framework 4 – 4.6 development tools
Blend for Visual Studio
Entity Framework 6 tools
.NET profiling tools
Just-In-Time debugger

Selecting the project and pressing Ctrl-B gives me a "New function break point" dialog.

Right-clicking the project does not give me an option to build the project.

It appears the project is not recognized as a C# project.

I also tried the developer command prompt, with the following result:

C:\Users\gchristian\git\TC3-2.4.1>msbuild WindowsApplication1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 10/28/2019 10:11:01 AM.
Project "C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsoleApplication.csproj" on node 1 (default targets)
.
PrepareForBuild:
  Creating directory "C:\Program Files\My Company\Tally System Console 3\.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(
1128,5): warning MSB3191: Unable to create directory "C:\Program Files\My Company\Tally System Console 3\. Access to
the path 'C:\Program Files\My Company\Tally System Console 3\ is denied. [C:\Users\gchristian\git\TC3-2.4.1\WindowsAppli
cation1\TallyConsoleApplication.csproj]
  The previous error was converted to a warning because the task was called with ContinueOnError=true.
  Build continuing because "ContinueOnError" on the task "MakeDir" is set to "True".
PreBuildEvent:
  "C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\BuildUpdater.exe" "C:\Users\gchristian\git\TC3-2.4.1\WindowsApplicat
  ion1\" TallyConsoleApplication
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(
1332,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The working directory "C:\Program Fil
es\My Company\Tally System Console 3\ does not exist. [C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsol
eApplication.csproj]
PostBuildEvent:
  if Debug == Release (
  "*Undefined*"PostBuild "C:\Program Files\My Company\Tally System Console 3\ "TallySystemConsole3.4.exe"
  )
  rem if Debug == Debug (
  rem "*Undefined*"PostBuild "C:\Program Files\My Company\Tally System Console 3\
  rem )
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(
5165,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The working directory "C:\Program Fil
es\My Company\Tally System Console 3\ does not exist. [C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsol
eApplication.csproj]
Done Building Project "C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsoleApplication.csproj" (default targ
ets) -- FAILED.

Build FAILED.

"C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsoleApplication.csproj" (default target) (1) ->
(PrepareForBuild target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.target
s(1128,5): warning MSB3191: Unable to create directory "C:\Program Files\My Company\Tally System Console 3\. Access t
o the path 'C:\Program Files\My Company\Tally System Console 3\ is denied. [C:\Users\gchristian\git\TC3-2.4.1\WindowsApp
lication1\TallyConsoleApplication.csproj]

"C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsoleApplication.csproj" (default target) (1) ->
(PreBuildEvent target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.target
s(1332,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The working directory "C:\Program F
iles\My Company\Tally System Console 3\ does not exist. [C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyCons
oleApplication.csproj]

"C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyConsoleApplication.csproj" (default target) (1) ->
(PostBuildEvent target) ->
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.target
s(5165,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The working directory "C:\Program F
iles\My Company\Tally System Console 3\ does not exist. [C:\Users\gchristian\git\TC3-2.4.1\WindowsApplication1\TallyCons
oleApplication.csproj]

    1 Warning(s)
    2 Error(s)

Time Elapsed 00:00:01.75

C:\Users\gchristian\git\TC3-2.4.1>


Monday, October 28, 2019 2:05 PM

Hi Peter,

Thanks for the suggestion but in this case right clicking on the project does not give a "Set as StartUp Project" option.


Monday, October 28, 2019 2:39 PM

I have a couple of screen shots but was not able to upload them because by account has not been validated yet.

Here is a dropbox link to the screen shots.

You can see from the screen shots the lack of a build menu item and also the context menu I get when right clicking the project.

Also in a third screen shot I added the Build menu, but you can see the Build buttons are grayed out.

Gerald

https://www.dropbox.com/sh/r4f7aqirqrordsb/AAC_DfjJCO0nxrP3gtzJrri1a?dl=0


Monday, October 28, 2019 4:06 PM

Hi Dylan,

I have a couple of screen shots but was not able to upload them because by account has not been validated yet.

Here is a dropbox link to the screen shots.

You can see from the screen shots the lack of a build menu item and also the context menu I get when right clicking the project.

Also in a third screen shot I added the Build menu, but you can see the Build buttons are grayed out.

Gerald

https://www.dropbox.com/sh/r4f7aqirqrordsb/AAC_DfjJCO0nxrP3gtzJrri1a?dl=0

Edited by Gerald Christian a few seconds ago


Tuesday, October 29, 2019 3:34 AM

Hi Gerald,

Thank you for feedback and sharing.

From the screenshot, it seems that you lack the .csproj file in your project folder. VS IDE needs csproj file to build your project, the csproj file contains the reference relationships and running configuration for your project.

So please copy the csproj file from the win7 machine to win10 machine. Or upload the csproj file to git then download, it is necessary.

Then you could right click csproj file -> set " set as start-up item", after that you could build normally it.

Best Regards,

Dylan 

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]