Skip to content

Commit

Permalink
#17: Raspberry Debug Settings: Can't find startup project in solution…
Browse files Browse the repository at this point in the history
… folder
  • Loading branch information
jefflill committed Dec 21, 2020
1 parent 92851fd commit c3bcdbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions RaspberryDebugger/PackageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,13 @@ public static Project GetStartupProject(Solution solution)
var projectName = (string)((object[])solution.SolutionBuild.StartupProjects).FirstOrDefault();
var startupProject = (Project)null;

// $todo(jefflill): when startup project is located solution folder following code will not find it.
foreach (Project project in solution.Projects)
{
if (project.UniqueName == projectName)
{
startupProject = project;
}
else if (project.Kind == EnvDTE.Constants.vsProjectItemKindSolutionItems)
else if (project.Kind == EnvDTE.Constants.vsProjectKindSolutionItems)
{
startupProject = FindInSubprojects(project, projectName);
}
Expand Down Expand Up @@ -492,12 +491,12 @@ public static Project FindInSubprojects(Project parentProject, string projectNam

var project = (Project)null;

if (project.Kind == EnvDTE.Constants.vsProjectKindSolutionItems)
if (parentProject.Kind == EnvDTE.Constants.vsProjectKindSolutionItems)
{
// The project is actually a solution folder so recursively
// search any subprojects.

foreach (ProjectItem projectItem in project.ProjectItems)
foreach (ProjectItem projectItem in parentProject.ProjectItems)
{
project = FindInSubprojects(projectItem.SubProject, projectName);

Expand Down
5 changes: 5 additions & 0 deletions Test/Blinkie/Blinkie.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blinkie31", "Blinkie31\Blinkie31.csproj", "{6EEFF8C7-49AA-4A94-84DA-B7E9CAE34160}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{F415615A-B38A-49E0-8296-D81F9B97E352}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,6 +53,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6EEFF8C7-49AA-4A94-84DA-B7E9CAE34160} = {F415615A-B38A-49E0-8296-D81F9B97E352}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D562AEEE-B9F3-45F0-8662-4F050E7D20E6}
EndGlobalSection
Expand Down

0 comments on commit c3bcdbe

Please sign in to comment.