How to suppress specific MSBuild warning

前端 未结 6 1677
悲&欢浪女
悲&欢浪女 2020-11-28 07:03

Is there any way to disable specific MSBuild warning (e.g. MSB3253) when running MSBuild from command line? My build script calls msbuild.exe much the following way:

6条回答
  •  野性不改
    2020-11-28 07:16

    I've managed to supress the warning level with /p:WarningLevel=X

    msbuild.exe MySolution.sln /t:Rebuild /p:WarningLevel=0 /p:Configuration=Release
                                          ^^^^^^^^^^^^^^^^^
    Warning  
    Level    Meaning
    -------- -------------------------------------------
          0  Turns off emission of all warning messages.
    
          1  Displays severe warning messages
    
          2  Displays level 1 warnings plus certain, less-severe warnings, such
             as warnings about hiding class members
    
          3  Displays level 2 warnings plus certain, less-severe warnings, such 
             as warnings about expressions that always evaluate to true or false
    
          4  (the default) Displays all level 3 warnings plus informational warnings
    

提交回复
热议问题