Skip to content

Have ProjectInSolution.AbsolutePath return a normalized path#5950

Merged
rainersigwald merged 2 commits intodotnet:masterfrom
jeffkl:fix-projectinsolution-absolutepath
Dec 16, 2020
Merged

Have ProjectInSolution.AbsolutePath return a normalized path#5950
rainersigwald merged 2 commits intodotnet:masterfrom
jeffkl:fix-projectinsolution-absolutepath

Conversation

@jeffkl
Copy link
Copy Markdown
Contributor

@jeffkl jeffkl commented Dec 9, 2020

This change updates ProjectInSolution.AbsolutePath to return a normalized path. At the moment it simply returns the result of a Path.Combine() which leaves ..\ path segments in place and does not contain OS-specific path separators.

Fixes #5949 and NuGet/Home#10307

Comment thread src/Build/Construction/Solution/ProjectInSolution.cs Outdated
@jeffkl jeffkl force-pushed the fix-projectinsolution-absolutepath branch from 46ffea4 to 74b8fc6 Compare December 10, 2020 16:48
@jeffkl jeffkl changed the title WIP Have ProjectInSolution.AbsolutePath return a normalized path Dec 10, 2020
@jeffkl jeffkl force-pushed the fix-projectinsolution-absolutepath branch from 85d8ddb to b4d19f6 Compare December 11, 2020 18:17
@jeffkl jeffkl marked this pull request as ready for review December 11, 2020 18:55
Comment thread src/Build/Construction/Solution/ProjectInSolution.cs Outdated
Comment thread src/Build/Construction/Solution/SolutionFile.cs Outdated
Comment thread src/Build/Construction/Solution/SolutionFile.cs Outdated
Comment thread src/Build/Construction/Solution/SolutionFile.cs Outdated
Comment thread src/Build.UnitTests/Construction/SolutionFile_Tests.cs Outdated
Comment thread src/Build.UnitTests/Construction/SolutionFile_Tests.cs Outdated
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I'd like it interactive rebased to have a commit for the shouldly migration and a separate commit for the actual change.

Comment thread src/Build.UnitTests/Construction/SolutionProjectGenerator_Tests.cs Outdated
@jeffkl jeffkl force-pushed the fix-projectinsolution-absolutepath branch from c1dbf39 to fc8e5cf Compare December 15, 2020 16:50
@rainersigwald rainersigwald merged commit 136652d into dotnet:master Dec 16, 2020
jeffkl added a commit to jeffkl/msbuild that referenced this pull request Mar 10, 2021
dotnet#5950 introduced a call to `Path.GetFullPath()` to get a path that is normalized.  However, in some cases Visual Studio stores unsupported paths which will cause `Path.GetFullPath()` to throw.

`Path.GetFullPath()` can also throw a `PathTooLongException` which is now handled.

Fixes dotnet#6236
benvillalobos pushed a commit to benvillalobos/msbuild that referenced this pull request Mar 16, 2021
dotnet#5950 introduced a call to `Path.GetFullPath()` to get a path that is normalized.  However, in some cases Visual Studio stores unsupported paths which will cause `Path.GetFullPath()` to throw.

`Path.GetFullPath()` can also throw a `PathTooLongException` which is now handled.

Fixes dotnet#6236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProjectInSolution.AbsolutePath should return a normalized full path

3 participants