From a76f2fd918c7628422faa7a4882b794ee09de70b Mon Sep 17 00:00:00 2001 From: Oski Kervinen Date: Mon, 30 Jan 2023 20:44:13 +0200 Subject: [PATCH] Fix exception when multiple projects reference the same .vcxitems project (#445) --- .../ProjectLoading/ProjectGraphProjectLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.VisualStudio.SlnGen/ProjectLoading/ProjectGraphProjectLoader.cs b/src/Microsoft.VisualStudio.SlnGen/ProjectLoading/ProjectGraphProjectLoader.cs index d13a650e..7093ad9c 100644 --- a/src/Microsoft.VisualStudio.SlnGen/ProjectLoading/ProjectGraphProjectLoader.cs +++ b/src/Microsoft.VisualStudio.SlnGen/ProjectLoading/ProjectGraphProjectLoader.cs @@ -64,7 +64,7 @@ public void LoadProjects(IEnumerable projectPaths, ProjectCollection pro _ = CreateProject(projectPath.FullName, globalProperties, projectCollection); } } - else if (importPath.EndsWith(ProjectFileExtensions.VcxItems)) + else if (importPath.EndsWith(ProjectFileExtensions.VcxItems) && !LoadedProjects.ContainsKey(importPath)) { _ = CreateProject(importPath, globalProperties, projectCollection); }