When you create a new project in Visual Studio, it defaults to a location under your user profile, typically something like C:\Users\YourName\source\repos or C:\Users\YourName\Documents\Visual Studio 20XX\Projects. Changing this default to a shorter, local path avoids issues with long file paths, UNC path problems with source control, and helps you organize your work consistently.
Why Change the Default Location
- Long path issues. The default path under your user profile can be deep, and combined with nested project folders, may exceed the Windows 260-character path limit.
- Source control compatibility. Some older source control systems (such as Visual SourceSafe) have issues with UNC paths or deeply nested folders.
- Organization. Keeping projects in a short, memorable path like
C:\DevorD:\Projectsmakes them easier to find and manage from the command line. - Rendimiento. Storing projects on a fast local drive rather than a redirected Documents folder or network share improves build times.
Changing the Default in Visual Studio (All Versions)
The setting is in the same general location across all Visual Studio versions, though the exact label has changed slightly over the years.
Visual Studio 2017, 2019, and 2022
- Open Visual Studio.
- Go to Tools > Options from the menu bar.
- In the Options dialog, expand Projects and Solucións in the left pane.
- Click Locations.
- You will see three configurable paths:
- Projects location — where new projects are created.
- User project templates location — where your custom project templates are stored.
- User item templates location — where your custom item templates are stored.
- Click the Browse button (…) next to Projects location and select your preferred folder (for example,
D:\Projects). - Click OK to save.
Visual Studio 2010, 2012, 2013, and 2015
- Open Visual Studio.
- Go to Tools > Options from the menu bar.
- Expand Projects and Solucións in the left pane.
- Click General.
- Update the Visual Studio projects location field to your preferred path.
- Optionally update the User project templates location and User item templates location.
- Click OK to save.
Visual Studio 2008
- Open Visual Studio 2008.
- Go to Tools > Options.
- Expand Projects and Solucións and click General.
- Change the Visual Studio projects location path.
- Click OK.
Verifying the Change
After updating the setting:
- Go to File > New > Project (or File > New Project in older versions).
- In the Create a new project dialog (or New Project dialog), check the Location field.
- It should now show your newly configured default path.
- You can still override this on a per-project basis by changing the location when creating the project.
Changing the Default via the Registry
If you need to set the default project location for multiple users or through a deployment script, you can modify the Windows Registry directly.
Advertencia: Editing the registry incorrectly can cause system instability. Always back up the registry before making changes.
Registry Paths by Version
The registry key follows this pattern:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\
| Visual Studio Version | Registry Version Number |
|---|---|
| VS 2008 | 9.0 |
| VS 2010 | 10.0 |
| VS 2012 | 11.0 |
| VS 2013 | 12.0 |
| VS 2015 | 14.0 |
| VS 2017 | 15.0 |
| VS 2019 | 16.0 |
| VS 2022 | 17.0 |
For Visual Studio 2017 and later, the settings are stored differently due to the instance-based installation model. The configuration is typically in:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>_<instance>\
The string value to modify is DefaultNewProjectLocation under the root key for that version. However, for VS 2017+, it is generally easier and safer to use the IDE settings or export/import settings files rather than editing the registry.
Example: Setting via Registry for VS 2015
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0]
"DefaultNewProjectLocation"="D:\\Projects"
Exporting and Importing Settings
You can export your Visual Studio settings (including the project location) to a file and import them on other machines:
- Go to Tools > Import and Export Settings.
- Select Export selected environment settings.
- Choose which settings to export (at minimum, select Projects and Solucións).
- Save the
.vssettingsfile. - On the target machine, use Tools > Import and Export Settings > Import selected environment settings and load the file.
This is the recommended approach for standardizing settings across a team.
Default Template Locations
Visual Studio stores project and item templates in specific locations:
Built-in Templates
C:\Program Files\Microsoft Visual Studio\<year>\<edition>\Common7\IDE\ProjectTemplates\
C:\Program Files\Microsoft Visual Studio\<year>\<edition>\Common7\IDE\ItemTemplates\
User Templates (Customizable)
The default user template locations can be changed in the same Options dialog:
- VS 2017+:
%USERPROFILE%\Documents\Visual Studio <year>\Templates\ProjectTemplates\ - VS 2010-2015:
%USERPROFILE%\Documents\Visual Studio <year>\Templates\ProjectTemplates\
Place your custom .zip template files in the user template directory. They will appear in the New Project dialog under My Templates or in the template search.
Mejores Prácticas
- Use a short, local path such as
C:\DevorD:\Projectsto avoid path length issues. - Avoid network paths for the default location. Network drives introduce latency and can cause issues with file locking during builds.
- Keep the path consistent across development machines to simplify documentation and team workflows.
- Do not use spaces in the project folder path if possible. While Visual Studio handles spaces correctly, some command-line tools and scripts may not.
- Separate from source control working folders if your source control system has its own workspace concept (for example, TFVC workspaces).
Solución de Problemas
The Location Field Resets After Restarting Visual Studio
This can happen if Visual Studio does not have write access to its settings file. Run Visual Studio as Administrator once to set the option, or check that the settings file at %LOCALAPPDATA%\Microsoft\VisualStudio\ is not read-only.
New Projects Still Go to the Old Location
Make sure you are not selecting a recently used location from the dropdown. The default only applies when you do not manually override the path in the New Project dialog.
Visual Studio Installed on a Different Drive
If Visual Studio itself is installed on a drive other than C:, the default project location may already point to that drive. Verify the current setting before making changes.
Resumen
Changing the default project folder in Visual Studio is a simple but impactful configuration. Navigate to Tools > Options > Projects and Solucións > Locations (or General in older versions) and set your preferred path. Use a short, local path to avoid file path length issues and improve build performance. For team-wide standardization, export and import the .vssettings file rather than editing the registry.