Skip to content

Use Path.Combine to build environment variables#178

Merged
Forgind merged 1 commit into
microsoft:masterfrom
Danielku15:feature/fix-dotnet-env-paths
Aug 29, 2022
Merged

Use Path.Combine to build environment variables#178
Forgind merged 1 commit into
microsoft:masterfrom
Danielku15:feature/fix-dotnet-env-paths

Conversation

@Danielku15
Copy link
Copy Markdown
Contributor

Fixes #176

As descibed in the issue it seems there are no trailing backslashes in some paths. To ensure proper paths in the environment variables I changed the string concatenation to a safer Path.Combine

Copy link
Copy Markdown
Contributor

@Forgind Forgind left a comment

Choose a reason for hiding this comment

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

I think I'd prefer to have an EnsureTrailingSlash method to adjust the path in each VisualStudioInstance (for core, specifically) then call it before each yield return:
https://github.com/microsoft/MSBuildLocator/blob/master/src/MSBuildLocator/DotNetSdkLocationHelper.cs#L126
and
https://github.com/microsoft/MSBuildLocator/blob/master/src/MSBuildLocator/DotNetSdkLocationHelper.cs#L153
but this is ok.

@Forgind
Copy link
Copy Markdown
Contributor

Forgind commented Aug 29, 2022

Thanks @Danielku15!

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.

Version 1.5.3 misses a trailing directory separator path

4 participants