Problem
When Right-Click on a solution folder in the explorer and adding a new project, the path isn't appended with a directory name automatically:
Cause
The Solution Folder isn't a real directory. It organizes projects in the solution only; It doesn't imply a filesystem location. These relationships are declared in the .sln file where the Solution Folder is a project of a specific type:
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder1", "SolutionFolder1", "{D9C9CE8A-0E54-4753-9247-C9E7E285713F}"
The project belonging to a solution folder is specified in the GlobalSection(NestedProjects) = preSolution section.
Considering the ConsoleApp2 is under the SolutionFolder1:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{55D2CE82-AD12-4077-9948-BF518B5784E9}"
, its GUID is bundled with GUID of SolutionFolder1 in the NestedProjects section:
GlobalSection(NestedProjects) = preSolution
{55D2CE82-AD12-4077-9948-BF518B5784E9} = {D9C9CE8A-0E54-4753-9247-C9E7E285713F}
EndGlobalSection
Resolution
The real path to the project needs to be specified explicitly on project creation. By default, a project directory creates next to the solution file (Solution.sln), for e.g. {PathToDirWithSlnFile}/NewProjectName/NewProjectName.csproj.
Comments
0 comments
Please sign in to leave a comment.