dotnet / dotnet/msbuild

Switch with no value uses default

Open
#7,288 0 comments 0 reactions 0 assignees View on GitHub
bug needs-design triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Issue Description
Switches infer default value when not provided.

### Steps to Reproduce
```
> dotnet build /nodemode
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1033: Node number is not valid. .
Switch: 0

For switch syntax, type "MSBuild -help"
```

### Expected Behavior
It should not tell me I put in a 0 when I didn't.

### Analysis
This looks like a default value problem, but I'm not sure what the best fix is. Having `Switch: ` is a bad experience, too.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the behavior with `dotnet build /nodemode` and inspect the command-line parsing path for the `/nodemode` switch. The payload names no source file or test, so first locate the relevant parser and existing switch-validation tests; done means the error no longer reports an inferred `0` when no value was supplied.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.