diff --git a/vsintegration/src/unittests/Tests.ProjectSystem.RoundTrip.fs b/vsintegration/src/unittests/Tests.ProjectSystem.RoundTrip.fs index 600adeb3ba1..6fa28965eba 100644 --- a/vsintegration/src/unittests/Tests.ProjectSystem.RoundTrip.fs +++ b/vsintegration/src/unittests/Tests.ProjectSystem.RoundTrip.fs @@ -100,6 +100,17 @@ type RoundTrip() = CompileItem @"A\qux.fs"] this.``FsprojRoundtrip.PositiveTest``(MSBuildItems origItems, MSBuildItems expectedItems) + [] + member public this.``FsprojRoundTrip.Regression.FoldersWithSameName``() = + let items = MSBuildItems [CompileItem @"First\Second\bar.fs" + CompileItem @"Second\qux.fs"] + this.``FsprojRoundtrip.PositiveTest``(items, items) + + [] + member public this.``FsprojRoundTrip.Regression.FoldersWithSameName2``() = + let items = MSBuildItems [CompileItem @"First\First\bar.fs"] + this.``FsprojRoundtrip.PositiveTest``(items, items) + member this.``Fsproj.NegativeTest``(items : MSBuildItems) = DoWithTempFile "Test.fsproj" (fun file -> File.AppendAllText(file, TheTests.SimpleFsprojText([], [], items.ToString())) diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/MSBuildUtilities.fs b/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/MSBuildUtilities.fs index 3e6c64bc697..97525f5c9dd 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/MSBuildUtilities.fs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/MSBuildUtilities.fs @@ -120,7 +120,7 @@ type internal MSBuildUtilities() = // push folder Inc(curPathParts) curPathParts.Add(pathParts.[curPathParts.Count]) // e.g. transition from A\ to A\D\E\bar.fs - if not(alreadyRenderedFolders.Add(curPathParts)) && throwIfCannotRender then + if not(alreadyRenderedFolders.Add(new List(curPathParts))) && throwIfCannotRender then raise <| new InvalidOperationException(String.Format(FSharpSR.GetString(FSharpSR.ProjectRenderFolderMultiple), projectNode.ProjectFile, bi.Include)) Inc(curPathParts) if bi.ItemType = ProjectFileConstants.Folder then