Jun 29 2022
09:12 AM
- last edited on
Mar 05 2024
01:50 PM
by
TechCommunityAP
Jun 29 2022
09:12 AM
- last edited on
Mar 05 2024
01:50 PM
by
TechCommunityAP
Hi,
I have several VSBuild@1 tasks in azure_pipelines.yml.
The C++\C# projects generate many warnings (3k+) at build time:
From the documentation here, I have tried passing several different parameters to msbuildArgs in order to suppress the warnings, but they still show up every build (e.g., -verbosity:quiet, -consoleloggerparameters:ErrorsOnly, /p:WarningLevel=0, /NoWarn, etc.).
Am I missing something with the syntax or are there different flags that I should be passing to msbuildArgs?
Note, I do not want to specify the exact warnings to supress (required by some flags). I'd like to output errors only for a cleaner build page.
- task: VSBuild@1
displayName: "Building..."
inputs:
configuration: $(Config)
msbuildArgs: "-maxCpuCount -consoleloggerparameters:ErrorsOnly"
platform: $(buildPlatform)
solution: $(solution)
vsVersion: "${{ parameters.CSharpVsVersion }}"
Any help is appreciated 🙂
-Brandon
Jun 30 2022 02:17 PM
Temporary solution:
- name: msbuildArgs
type: string
default: "-maxCpuCount
-consoleloggerparameters:ErrorsOnly
-property:WarningLevel=0
-property:RunCodeAnalysis=false
-noWarn:C4244,C4267,C4311,C4302,C4477,C4838,MSB3245,MSB3277,MSB3270,MSB3042,C4996,C4101,C4312,C4474,LNK4099,C4715,LNK4017,C4091,C4334,C4700,C4192,C4129,C4805"
Then pass msbuildArgs to the steps:
- ${{ each project in parameters.CPlusPlusProjects }}:
- task: VSBuild@1
displayName: "Building ${{ project }}"
inputs:
solution: ${{ project }}
platform: ${{ parameters.buildPlatform }}
configuration: ${{ parameters.buildConfiguration }}
vsVersion: ${{ parameters.CPlusPlusVsVersion }}
msbuildArgs: ${{ parameters.msbuildArgs }}
logFileVerbosity: quiet
Note, multi-line object doesn't work for the msbuildargs parameter, each separate parameter can exist on it's own line, but each error code cannot. For example, the below will not work:
- name: msbuildArgs
type: string
default: "-maxCpuCount
-consoleloggerparameters:ErrorsOnly
-property:WarningLevel=0
-property:RunCodeAnalysis=false
-noWarn:C4244,
C4267,
C4311,
C4302,
C4477,
C4838,
etc...