Skip to content

$([MSBuild]::MakeRelative()) returns different values on 16.10 than older version #6493

@yodovicz

Description

@yodovicz

Issue Description

Newest version of VisualStudio (MSBuild 16.10) return different values on msbuild property function MakeRelative() with paths ending backslash.

Steps to Reproduce

code: $([MSBuild]::MakeRelative('c:\windows\', 'c:\windows\system32\'))
MSBuild 16.10 returns: 'system32'
MSBuild 16.9 and older returns: 'system32\'

Expected Behavior

according to https://docs.microsoft.com/en-us/dotnet/api/system.uri.makerelativeuri?view=net-5.0
it should returns 'system32\'

Actual Behavior

returns 'system32'

Analysis

MSBuild unittests does not contains paths ending backslash
https://github.com/dotnet/msbuild/blob/main/src/Shared/UnitTests/FileUtilities_Tests.cs#L86

Versions & Configurations

16.10.0.26302

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions