Skip to main content
Version: 2023.4

7.2. Probing Paths

Probing paths is a set of places at the file system where Eazfuscator.NET can search for dependencies of input assembly. Eazfuscator.NET is smart enough to deduct these paths from installed assemblies and from project settings, however it might be necessary to define probing paths manually when some complex scenario is involved.

7.2.1. How to Define Probing Paths?​

There are two ways to define probing paths: by declarative obfuscation attributes or by command line option.

To define a probing path, you should apply an attribute to your assembly. In order to do that, you can use the instructions below.

Instructions on defining the probing path by declarative obfuscation attribute

  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 = @"assembly probing path C:\Example\Lib")]

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

    Imports System
    Imports System.Reflection

    <Assembly: Obfuscation(Feature:="assembly probing path C:\Example\Lib")>
    Note

    Change C:\Example\Lib with the directory name you want to be probed for assembly dependencies.

    Tip

    It is recommended to use relative directory paths with script variables:

    [assembly: Obfuscation(Feature = @"assembly probing path $(InputDir)\Lib")]
    Tip

    If you want to define several probing paths then just add several attributes:

    [assembly: Obfuscation(Feature = @"assembly probing path C:\Example\Lib1")]
    [assembly: Obfuscation(Feature = @"assembly probing path C:\Example\Lib2")]
    …

Way #2. Define probing paths by a command-line option​

There is a command line option --probing-paths "C:\Example\Lib" which can be specified to achieve this functionality. If you want to define several probing paths then please use semicolon as a list separator: --probing-paths "C:\Example\Lib1;C:\Example\Lib2".

Note

Change C:\Example\Lib with the directory name you want to be probed for assembly dependencies.

Warning

Do not put a trailing slash at the end of the path, otherwise the operating system will interpret it as an escape symbol.