dotnet / dotnet/msbuild

[Bug]: Transforming backslashes to slashes next to a property value on macOS

Open
#9,200 3 comments 1 reaction 0 assignees View on GitHub
backlog bug Priority:3 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description

This is maybe not a bug, but I did not manage to find a way to get a single trailing backslash when building up a relative path in a project file (please see the repro steps).

PS If there is an existing/proper way to do this, I would like to know the way. Thank you!

### Steps to Reproduce

1. Create a simple project:
```xml


mydir\$(MyFileName)\
mydir\$(MyFileName)/////////\
mydir\$(MyFileName)\\





```
2. Build the project
```bash
dotnet msbuild -p:MyFileName=file
```

### Expected Behavior

Not sure what is the expected behaviour, but I wanted to achieve to get a single trailing backslash:
```
mydir\file\
```

### Actual Behavior

The build prints out:
```
MSBuild version 17.8.0-preview-23367-03+0ff2a83e9 for .NET
RelativePath1: mydir\file/
RelativePath2: mydir\file/
RelativePath3: mydir\file\\
```

### Analysis

_No response_

### Versions & Configurations

dotnet sdk version: `8.0.100-preview.7.23376.3`
machine/OS: `MacBookPro M1` - macOS Ventura: `Version 13.5.1 (22G90)`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.