Skip to content

Bug: MSBuild /switch parameters misidentified as file paths on Windows #2234

@rip-nsk

Description

@rip-nsk

Describe the bug

When running msbuild foo.vcxproj /p:Configuration=Release /nologo /v:minimal, the CLI's path safety check treats /nologo (and other /-prefixed MSBuild switches) as filesystem paths, showing a false "Allow directory access" prompt. This is a Windows-specific issue where MSBuild uses / for switches, not -. The heuristic should exclude known tool switches or at least check if the "path" actually exists.
The same issue is likely to affect other command-line utilities.

Affected version

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions