views:

48

answers:

3

How do you get Visual C# 2010 to go along with the idea of putting source files in a subdirectory, that is, *.cs moves to src\*.cs while leaving everything else where it is? It's probably something very simple, I just tried creating a test class as src\myclass.cs instead of plain myclass.cs and Visual C# would have none of it.

+4  A: 

Right-click the project add new folder, right-click the folder add new item.

Adam
+1  A: 

Or you can just create the class as usual and in the ProjectExplorer in VS you can move the class into a folder like in the normal explorer.

Chilln
+1 Yes, dragging and dropping inside a project will initiate a move action. Dragging and dropping across projects initiates a copy.
Adam
A: 

What you have to remember is that the directories are only for the developers purposes, once you hit compile that does not matter because all files get put into 1 root compilation.

But as both František Žiačik and rwallace said, by going to your Project Manage area to the right of your VS you will see a set of files and folders, just right click the top one to expand the right click menu and you should see Add Item just go in there and click folder.

Stay cool

RobertPitt