dotnet / dotnet/msbuild

MSBUILDWARNINGSASMESSAGES not suppressing intermittently

Open
#4,486 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

### Steps to reproduce

Either include a project sample, attach a zipped project, or provide IDE / CLI steps to create the project and repro the behaviour. Example of a project sample:

Project file
```xml


...
MSB3245

...
```

Directory contents:
```
/
- dirs.proj
- src/
- dirs.proj
- dir1/
- app.config
- myproj.csproj
...
```

Command line
```
& $msbuild @($proj, '/nologo', '/nr:false', '/t:Clean', '/t:Build', '/m', '/p:MSBUILDWARNINGSASMESSAGES=MSB3277', '/warnaserror')
if ($?)
...
```
or generally, since we have the MSBUILDWARNINGSASMESSAGES element in the offending .csproj's,
```
msbuild /warnaserror
```
### Expected behavior
build succeeds always - the warnings are always messages, and never get elevated to errors

### Actual behavior
Command 1 will fail. When Command 1 fails, $? can however return success.

Command 2 may or may not fail. When Command 2 fails, it can be for any of the projects we already 'fixed' with MSBUILDWARNINGSASMESSAGES.

### Environment data
`msbuild /version` output:

Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

16.1.76.45076

OS info:

If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):
vs 2019 developer command prompt v16.1.4
also, separately,
Powershell
Major Minor Build Revision
----- ----- ----- --------
5 1 18362 145

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.