Why does Visual Studio always do the wrong thing when creating a new solution or project file in an existing directory.
Consider the following scenario.
- There is source code but no project file in the directory c:\Path\To\ProjectName.
- You create a new project file named ProjectName in the directory c:\Path\To\ProjectName. You expect the project file to be directory c:\Path\To\ProjectName\ProjectName.vcxproj because that makes sense.
Note that ProjectName is already repeated twice in that path. - What Visual Studio actually does is create a directory named ProjectName in the directory c:\Path\To\ProjectName and then places the file ProjectName.vcxproj in that directory so that the full path to the project file becomes c:\Path\To\ProjectName\ProjectName\ProjectName.vcxproj.
Now you have a path where ProjectName is repeated three times.
Every time this happens I have close the solution file, to go to the directory in Windows Explorer, move the project file up a level, delete the extra ProjectName directory, manually edit the solution file in a text editor, then reopen the solution file in Visual Studio. Please, just put the project file in the specified directory.