dotnet / dotnet/msbuild

Normalize drive letter on Windows.

Open
#14,661 0 comments 0 reactions 0 assignees View on GitHub
backlog triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Consider empty project file (``) at `M:\Temp\Path\To\Project\Project.proj` and current directory in `M:\Temp`. With following CMD session
```
M:\Temp>dotnet msbuild Path/To/Project/Project.proj -getproperty:MSBuildProjectDirectory
M:\Temp\Path\To\Project

M:\Temp>dotnet msbuild Path/To/Project/ -getproperty:MSBuildProjectDirectory
M:\Temp\Path\To\Project

M:\Temp>dotnet msbuild \Temp/Path/To/Project/ -getproperty:MSBuildProjectDirectory
M:\Temp\Path\To\Project

M:\Temp>dotnet msbuild M:/Temp/Path/To/Project/ -getproperty:MSBuildProjectDirectory
M:\Temp\Path\To\Project

M:\Temp>dotnet msbuild m:/Temp/Path/To/Project/ -getproperty:MSBuildProjectDirectory
m:\Temp\Path\To\Project
```
you can see that MSBuild normalize project path, except when small `m` explicitly passed as drive letter, it remains small.
### Why does it matter?
In normal SDK, project path (including drive letter) will ends up in build generated `Project.GeneratedMSBuildEditorConfig.editorconfig` file. So, each time case of drive letter changed, this file need to be updated and all dependent targets rebuild.
### How it affect me?
VS Code C# extension is keen on explicitly passing small drive letter for design time build for its language server. That means following command line build (that includes `${workspaceFolder}` relative entries in VS Code's `tasks.json`) needs to rebuild much more than actually necessary.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Windows commands against the empty Project.proj and compare MSBuildProjectDirectory when the drive letter is uppercase or lowercase. Trace how that project path reaches Project.GeneratedMSBuildEditorConfig.editorconfig, then add coverage showing equivalent drive-letter casing does not cause unnecessary generated-file changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.