title: dotnet build command-line WarningLevel ignored
body: <p>I've got a situation where I'm creating a publish step in a CICD pipeline. A part of this is building the application with publish command-line parameters. In the project (.NET 6 webapp), there are warnings kicking out. For the build step, the devs will care about warnings. For publishing, I want to suppress them. Based on this blog post, <a href="https://devblogs.microsoft.com/dotnet/automatically-find-latent-bugs-in-your-code-with-net-5/" rel="nofollow noreferrer">Automatically find latent bugs in your code with .NET 5</a>, in order to suppress messages, I need to configure the analysis level to either &quot;none&quot; or a previous framework level (i.e., 4). Testing with</p>
  <p><code>dotnet build --no-incremental --configuration Debug project.csproj //p:DeployOnBuild=true;DeployTarget=Package;CreatePackageOnPublish=true;WarningLevel=3;AnalysisLevel=4</code></p>
  <p>the warning are still present. The same if I use <code>AnalysisLevel=none</code>.</p>
  <p>What am I missing here to suppress warnings on a build with publish?</p>