Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 "Add Item" directory change

Is there any way to change the default directory Visual Studio 2010 uses when you add a source file through Add -> New Item?

like image 874
dotminic Avatar asked May 17 '11 13:05

dotminic


2 Answers

Add New Item simply adds the item based on which project directory you're currently in or have selected in your Solution Explorer. If you want to change where it gets added then select the target location in the Solution Explorer first.

This behavior is obvious when right-clicking in the Solution Explorer, but it's also the same when using Project -> Add New Item....

like image 170
Ahmad Mageed Avatar answered Nov 11 '22 03:11

Ahmad Mageed


Since my comment seems to be the actual answer, I repost:

In the toolbar of Solution Explorer, there's a button "Show all files" (or similar, I'm using the German version). This switches the view to directories, rather than filters. In this view, you can right-click on the desired target folder to add items.

This does not actually change the default directory, but since you have to click somewhere anyway to add an item, this is the easiest approach.

Note that even when only using Visual C++, I'd recommend the Productivity Power Tools extension, which comes with Solution Navigator. In C++, this is not as powerful as with .NET, but it still has several features that are useful in C++ and can fully replace Solution Explorer.

like image 24
OregonGhost Avatar answered Nov 11 '22 03:11

OregonGhost