2010-01-12 58 views

回答

13

最好的方法是解決導致警告的問題。

如果必須忽略警告(例如,你繼承了這麼多,你不能見樹不見林的一個項目),你可以嘗試改變WarningLevel財產,http://msdn.microsoft.com/en-us/library/13b90fz7.aspx

+0

謝謝!這正是發生的事情!此外,軟件在這裏發佈的方式要求非開發人員從軟件庫中構建,並且我希望爲他們禁止警告。 但是,當時間出現時,問題將得到解決。 – 2010-01-13 17:54:31

56

的MSBuild/CLP :ErrorsOnly

 
    /consoleloggerparameters: 
        Parameters to console logger. (Short form: /clp) 
        The available parameters are: 
         PerformanceSummary--Show time spent in tasks, targets 
          and projects. 
         Summary--Show error and warning summary at the end. 
         NoSummary--Don't show error and warning summary at the 
          end. 
         **ErrorsOnly--Show only errors.** 
         WarningsOnly--Show only warnings. 
         NoItemAndPropertyList--Don't show list of items and 
          properties at the start of each project build. 
         ShowCommandLine--Show TaskCommandLineEvent messages 
         ShowTimestamp--Display the Timestamp as a prefix to any 
          message. 
         ShowEventId--Show eventId for started events, finished 
          events, and messages 
         ForceNoAlign--Does not align the text to the size of 
          the console buffer 
         DisableMPLogging-- Disable the multiprocessor 
          logging style of output when running in 
          non-multiprocessor mode. 
         EnableMPLogging--Enable the multiprocessor logging 
          style even when running in non-multiprocessor 
          mode. This logging style is on by default. 
         Verbosity--overrides the /verbosity setting for this 
          logger. 
+0

如果您想禁止特定的警告,則這可能不起作用。例如。在我的情況下,我想禁止警告MSB3270。 – 2013-11-27 04:49:23

+0

令人驚訝的幫助文檔:https://msdn.microsoft.com/en-us/library/ms164311.aspx – Ben 2015-01-23 18:37:31

5

如果你想抑制MSB3270只有這樣,你可以設置的項目文件,

<PropertyGroup> 
    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> 
    None 
    </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> 
</PropertyGroup>