简体   繁体   中英

Visual Studio 2010 Issue - Solution & Source Control explorer mismatch - Adding projects to sub-folder still maps to root

While adding a class library to a sub-folder in VS 2010...the default folder structure populated in the wizard still point to the parent.

̶S̶o̶,̶ ̶i̶n̶ ̶S̶o̶l̶u̶t̶i̶o̶n̶ ̶E̶x̶p̶l̶o̶r̶e̶r̶ ̶t̶h̶e̶ ̶a̶d̶d̶e̶d̶ ̶f̶o̶l̶d̶e̶r̶ ̶a̶p̶p̶e̶a̶r̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶r̶o̶o̶t̶.̶

EDIT: In Solution Explorer it is fine...and it appears exactly under the folder I added it to. But in Source Control explorer it appears in the root...because the wizard by default points it there. Unless I am careful enoughto change it at that stage ...the library is added to the root.

Is there a setting to resolve this issue?

Solution explorer's folders are virtual folders. That is, they do not relate to folders on the disk. I'm thinking you created a folder in VS and then right mouse clicked on it to add a new project. If so, what your seeing is correct (intended) behaviour.

To do what you want to do, in the "Add New Project" form click on the "Browse" button at the bottom next to "Location". Browse to the folder you want to put the project in (it will create another child folder here). Once you do this the project will appear in the root of the solution in VS. Now drag it to the solution folder you want to use.

Note: I think you might have trouble with a creating a solution folder of the same name as a real disk folder. Not sure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM