VS 2010 Source Directories

Started by
3 comments, last by Chicktopus 12 years, 11 months ago
Hi guys, I'm a little stuck on this one.

Basically I just need to change the default source code directory of a project in Visual Studio 2010, but I've had a look through all the project properties and such and can't find anywhere to change it. Any thoughts?
Advertisement
What do you mean by default? When you add a new file, it defaults to putting you in the same directory as the project file (and that you can't change), but you can add files from anywhere to your project.
-- gekko
I mean that when you create a project, Visual Studio will automatically create a folder, which it saves your source files to. For example, a project called Demo would have a folder called Demo\Demo in which it would save any source and header files you produce. I need a way to change this folder to be something else, like Demo\OtherDemo. I can't just rename the folder or Visual Studio can't find the source files if I do so.
The project file saves the relative path to all the files you've added to it, so if you need to make this change to an existing project, you can open up the file as XML and change the the path. You may need to remove and re-add the project to the solution as well, since that will now be in the "OtherDemo" directory. It should work though.

By default it's creating the "Demo" folder because you named your project "Demo", and there's no way around that to my knowledge. If I want it in a different folder, I just create the project, remove it from the solution, move it to its new location, and then re-add it to the solution. It's not elegant, but I really don't spend too much time creating projects so it doesn't bother me.
-- gekko
Alright, cheers. I'll see if I can fix it!

This topic is closed to new replies.

Advertisement