Change the default source file directory in Visual Studio

It doesn’t work, but I thought I should ask because it is a little annoying. Let's say I create a new project and start putting the source files in a directory other than the default that appears the first time. Afterwords, whenever I open a project, I have to go to the source directory once during this session. As I said, it doesn’t matter (but if solvable, then this is the icing on the cake). Several times, I absent-mindedly placed the source file in the default directory and ended up transferring this file to SVN, and if I was lucky, looking at all the files, deleting them, and then adding them again.

So my question is: is there a way to specify the default source directory for each project?

+23
visual studio
Aug 15 '10 at 20:36
source share
3 answers

I ran into the same trouble. I like to put the public interface header files in the library in a separate directory, but end up with typos in the file directory, because I forgot to go to the correct directory when saving a new file. Unfortunately, Visual Studio does not offer settings for changing the default directory for new C ++ source files.

+2
Dec 11
source share

I had the same problem when I started using build systems (CMake, Premake), which require me to save the project files separately from the source files, which complicates my workflow.

Although changing the default source directory seems impossible if you are not afraid to spend money, the workaround I found was to use the Visual Assist extension.

  • You can bind a shortcut of your choice to the Create File command, which creates a new file relative to the directory or your open file.
  • I would also recommend setting up one workflow around the wonderful Create from Use (which I think greatly improves performance), which virtually eliminates the need to manually create files.

The extension is excellent, although a little expensive. I would really like Microsoft to include these features directly in the IDE in the end, since vanilla has found them in many other IDEs, for example. Eclipse, Intellij.

There may be free extensions that do the same, but I have not found them.

0
May 08 '15 at 18:44
source share

Changing the default project folder may help. This page demonstrates how to change the default value for Visual Studio 2005, and it should be the same for later versions.

-3
Jun 03 '11 at 20:16
source share



All Articles