2010-01-12 17 views

Respuesta

13

La mejor manera es solucionar los problemas que están causando las advertencias.

Si debe ignorar las advertencias (por ejemplo, usted ha heredado un proyecto con tantas que no se puede ver el bosque por los árboles), podría intentar cambiar la propiedad WarningLevel, http://msdn.microsoft.com/en-us/library/13b90fz7.aspx

+0

Gracias! ¡Eso es exactamente lo que sucedió! Además, la forma en que se lanza el software aquí requiere que los no desarrolladores construyan desde los repositorios de software y quiero que las advertencias sean suprimidas por ellos. Pero sí, cuando se presente el tiempo, los problemas se solucionarán. –

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

Esto podría no funcionar si desea suprimir una advertencia específica. P.ej. en mi caso, me gustaría suprimir la advertencia MSB3270. –

+0

Documentación sorprendentemente útil: https://msdn.microsoft.com/en-us/library/ms164311.aspx – Ben

5

Si desea suprimir MSB3270 sólo entonces se puede establecer en el archivo de proyecto simplemente

<PropertyGroup> 
    <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> 
    None 
    </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> 
</PropertyGroup> 
Cuestiones relacionadas