Change default project folder in Visual Studio 2017 to a OneDrive folder

Change default project folder in Visual Studio 2017 to a OneDrive folder

November 17, 2018 0 By bernierh

Introduction

Today, I was moving my files to my new Surface Studio 2 (which is an awesome development machine!); All my personal files are synched to OneDrive, except for my Visual Studio and GitHub project files which are — by default — stored in c:\users[myuseraccount]\source\repos.

Synching your personal files to OneDrive makes it really easy to work on multiple devices or making sure that you have a backup in case your workstation is stolen, lost, self-destroyed, or abducted by aliens.

Making sure that your project files are also synched ensures that all those prototypes, proofs of concepts, and other code snippets that you never bothered adding to source control are also safe.

This article describes the steps to move your default project location to a folder that can be stored in OneDrive.

Let’s make one thing clear: synching your project files to OneDrive does not replace using source control; if you have any production code in your project files, please use source control.

Change the default project directory

  1. In Visual Studio 2017, select the Tools menu, then Options.
  2. In the Options dialog select the Projects and Solutions category, then Locations.
  3. In the Projects location type (or browse to) a folder on your OneDrive where you want your new projects to be created.
  4. Click OK.Project location in Visual Studio 2017

Changing the default Github repo location in Visual Studio

  1. In Visual Studio, make sure you’re connected to GitHub.
  2. From the Team Explorer pane, go to Settings.
  3. In the Settings pane, select Global Settings.
  4. In the Global Settings pane, type (or browse to) the folder you want to use in the Default Repository Location.
  5. Click Update.GitHub Settings

Conclusion

The instructions above will default your new Visual Studio projects and repos in a OneDrive folder; they’ll get synchronized with OneDrive.

Thanks to Martin Zikmund for the detailed steps on how to set up the folder in Visual Studio.  Also, Andrew Grant has a great video showing how to do the above steps.

I hope this helps!?