Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Path.Combine to build environment variables #178

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

Danielku15
Copy link
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
Member

@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
Member

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