Skip to main content
Version: 2023.4

7.8. Warnings and Errors

Eazfuscator.NET can produce warning and error messages. Generally, every warning and error message can be identified by a special identifier which has the form EF-XXXX. Example identifier: EF-4001.

7.8.1. Warning Suppression

Please follow the instructions below to disable a specific warning.

Instructions on disabling a specific warning

  1. Open obfuscatable project inside the IDE

  2. Add new source file to the project and call it ObfuscationSettings.cs (for C#) or ObfuscationSettings.vb (for Visual Basic .NET). You may prefer to use another name instead of ObfuscationSettings.cs or ObfuscationSettings.vb

  3. Fill ObfuscationSettings.cs with the following content (C#):

    using System;
    using System.Reflection;

    [assembly: Obfuscation(Feature = "disable warning EF-XXXX")]

    For Visual Basic .NET, fill ObfuscationSettings.vb with the following content:

    Imports System
    Imports System.Reflection

    <Assembly: Obfuscation(Feature:="disable warning EF-XXXX")>
Note

EF-XXXX must be changed with an identifier of a warning you want to disable.

Warning suppression directives can be specified at the assembly, class and member levels.

7.8.2. Treat Warnings as Errors

Please follow the instructions below to treat all warnings as errors.

Instructions on making Eazfuscator.NET to treat all warnings as errors

  1. Open obfuscatable project inside the IDE

  2. Add new source file to the project and call it ObfuscationSettings.cs (for C#) or ObfuscationSettings.vb (for Visual Basic .NET). You may prefer to use another name instead of ObfuscationSettings.cs or ObfuscationSettings.vb

  3. Fill ObfuscationSettings.cs with the following content (C#):

    using System;
    using System.Reflection;

    [assembly: Obfuscation(Feature = "treat all warnings as errors")]

    For Visual Basic .NET, fill ObfuscationSettings.vb with the following content:

    Imports System
    Imports System.Reflection

    <Assembly: Obfuscation(Feature:="treat all warnings as errors")>
Tip

There is a command-line option --warnings-as-errors all which can be specified to achieve this functionality.

Sometimes it can be useful to treat just a specific warning as an error. Please follow the instructions below to achieve this.

Instructions on making Eazfuscator.NET to treat a specific warning as an error

  1. Open obfuscatable project inside the IDE

  2. Add new source file to the project and call it ObfuscationSettings.cs (for C#) or ObfuscationSettings.vb (for Visual Basic .NET). You may prefer to use another name instead of ObfuscationSettings.cs or ObfuscationSettings.vb

  3. Fill ObfuscationSettings.cs with the following content (C#):

    using System;
    using System.Reflection;

    [assembly: Obfuscation(Feature = "treat warning EF-XXXX as error")]

    For Visual Basic .NET, fill ObfuscationSettings.vb with the following content:

    Imports System
    Imports System.Reflection

    <Assembly: Obfuscation(Feature:="treat warning EF-XXXX as error")>
Note

EF-XXXX must be changed with an identifier of a warning you want to treat as an error.

Tip

There is --warnings-as-errors command-line option which can be specified to achieve this functionality.