Share via


VCCLCompilerTool.WarningLevel (Propiedad)

Obtiene o establece un valor que representa lo estricto que debe ser el compilador a la hora de comprobar posibles construcciones sospechosas. WarningLevel expone la funcionalidad de la opción /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Nivel de advertencia) del compilador de C++ y la opción /w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won (Nivel de advertencia) del compilador de MIDL.

Espacio de nombres:  Microsoft.VisualStudio.VCProjectEngine
Ensamblado:  Microsoft.VisualStudio.VCProjectEngine (en Microsoft.VisualStudio.VCProjectEngine.dll)

Sintaxis

'Declaración
Property WarningLevel As warningLevelOption
warningLevelOption WarningLevel { get; set; }
property warningLevelOption WarningLevel {
    warningLevelOption get ();
    void set (warningLevelOption value);
}
abstract WarningLevel : warningLevelOption with get, set
function get WarningLevel () : warningLevelOption 
function set WarningLevel (value : warningLevelOption)

Valor de propiedad

Tipo: Microsoft.VisualStudio.VCProjectEngine.warningLevelOption
Valor de enumeración warningLevelOption.

Comentarios

Utilice la enumeración warningLevelOption para cambiar el valor de la propiedad WarningLevel .

Ejemplos

Vea Cómo: Compilar el código de ejemplo de extensibilidad del modelo de proyecto para obtener información sobre cómo compilar y ejecutar este ejemplo.

En el ejemplo siguiente se modifica la propiedad WarningLevel del compilador en el entorno de desarrollo integrado (IDE):

' add reference to Microsoft.VisualStudio.VCProjectEngine.
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub Test()
        Dim prj As VCProject
        Dim cfgs, tools As IVCCollection
        Dim cfg As VCConfiguration
        Dim tool As VCCLCompilerTool
        prj = DTE.Solution.Projects.Item(1).Object
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        tool = cfg.Tools("VCCLCompilerTool")
        tool.WarningLevel = warningLevelOption.warningLevel_0
    End Sub
End Module

Seguridad de .NET Framework

Vea también

Referencia

VCCLCompilerTool Interfaz

Microsoft.VisualStudio.VCProjectEngine (Espacio de nombres)