I went to Environment Variables in the Advanced tab of System Properties and added a new System variable like this:

name: msbuild35
value: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe

but when I try to run msbuild35 I still get the 'not recognized...' message

What am I missing?


You need to add ;C:\Windows\Microsoft.NET\Framework\v3.5\ to the end of the PATH environment variable.

You will likely need to close and reopen your command line window for the changes to take effect.

  • Hmm, still no luck. Could it be a permissions issue? I even tried rebooting to no avail. Also just tried running CMD as admin, no dice. – MetaGuru Mar 14 '11 at 19:02
  • 2
    are you typing msbuild35 or msbuild? The program is called msbuild.exe so you should be typing msbuild. You could use your msbuild35 environment variable by using: %msbuild35% if you really wanted. – Majenko Mar 14 '11 at 19:10
  • I hope windows will detect the env variable without restarting.. :-/ – Bibhas Mar 14 '11 at 20:37
  • How to use such Variables in Windows PowerShell 2 ? Calling %Var_Name% throws an error... – V-Light Aug 30 '11 at 19:12

Open the Environment Variables dialog from the Advanced tab of System Properties again and do the following.

  1. Delete msbuild35 that you created earlier; it is not necessary
  2. Look for the Path variable in both sections (user and system)
  3. If there is one in the user section, please let us know since that is unusual
  4. Select the Path variable from the System Variables section and click Edit
  5. Look for C:\Windows\Microsoft.NET\Framework\v3.5 in the value field of the dialog (you may want to copy the contents of the field to Notepad to make it easier to examine)
  6. Verify that there is a semicolon before it, and if it is not the last item, after it as well
  7. Click OK, OK, OK
  8. Reboot
  9. Open a command prompt and type msbuild
  10. Let us know if it still does not work
  • 1
    Rebooting is not necessary if updates are done through the GUI. It will be enough to open a new Command Prompt through Explorer (e.g., Start Menu). – grawity Mar 14 '11 at 22:07
  • 1
    Not necessarily. Using the GUI does indeed send the WM_SETTINGCHANGE message, but that only works with normal environments. If there are any variables that include other variables, then suddenly variables stop getting expanded and a reboot is required (but only for users, ie, opening an elevated command-prompt still expands). – Synetech Mar 14 '11 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.