PreEmptive Protection - Dotfuscator
Community Edition User Guide

Analytics Attributes

This page lists the attributes that control the injection of Analytics.

All of the following attributes are defined in the PreEmptive.Attributes namespace, which for brevity will be omitted from the titles of the sections below.

Some properties are only recognized by Dotfuscator Professional Edition and are thus not listed in this documentation.

Note that injection in general is controlled by the Process PreEmptive analytics attributes global option. If this option is disabled, no code will be injected despite any attributes.

BusinessAttribute

Identifies the company that owns the assembly being injected. Required for Analytics and Check Telemetry.

  • Applies to: Assembly

  • Prerequisites: None

  • Properties

    • CompanyKey: Required. A GUID string that uniquely identifies the company. Typically, this is provided by PreEmptive Solutions, so that data of particular companies may be routed correctly. If you are using the Community Workbench, then this value should be 7d2b02e0-064d-49a0-bc1b-4be4381c62d3 (the default value in the GUI).

    • CompanyName: Recommended. A string identifying the company, used for easier human readability when data is aggregated in an Analytics server.

ApplicationAttribute

Identifies the application of the assembly being injected. Required for Analytics and Check Telemetry.

  • Applies to: Assembly

  • Prerequisites: None

  • Properties

    • Guid: Required. A GUID string that uniquely identifies the application within the company.

    • Name: Recommended. A string identifying the application, used for easier human readability when data is aggregated in an Analytics server. If blank, the filename of the assembly will be used instead (if possible to obtain via reflection at runtime).

    • Version: Optional. A string identifying the version of the application, for filtering data aggregated in an Analytics server. If blank, the assembly's version will be used instead (if possible to obtain via reflection at runtime).

    • ApplicationType: Optional. A string identifying the type of the application, for filtering data aggregated in an Analytics server. If blank, the assembly's type (e.g., .exe) will be used instead (if possible to obtain via reflection at runtime).

BinaryAttribute

Identifies the assembly being injected. If present on an assembly, it is used for reporting the originating assembly of Analytics events and Check Telemetry.

  • Applies to: Assembly

  • Prerequisites: None

  • Properties

    • Guid: Required. A GUID string that uniquely identifies the assembly within the application.

SetupAttribute

Indicates that Dotfuscator should inject start-of-session code at the start of the annotated method. The injected code sets up Analytics and generates a session start message.

A method with a SetupAttribute must be called at runtime before any Analytics can be transmitted, so it should be placed as close as possible to the normal application startup logic.

This attribute specifies the destination endpoint of Analytics reporting via its StaticEndpoint property. Additionally, this attribute can implement user Analytics opt-in/opt-out behavior.

  • Applies to: Method

  • Prerequisites

  • Properties

    • StaticEndpoint: Required. The URL, without the protocol, to which Analytics and Check Telemetry should be transmitted. Defaults to the URL of the free Analytics endpoint.

    • OptInSourceElement: Specifies a source indicating the user's intent to opt-in.

      • May be a bool method argument, field, or property; or a method with the signature bool().

      • If "None" (default), the user is always opted-in.

    • OptInSourceName: Specifies the name of that source.

    • OptInSourceOwner: Specifies the declaring type of that source.

TeardownAttribute

Indicates that Dotfuscator should inject end-of-session code into the annotated method's exit points. The injected code generates a session stop message, transmits any queued messages, and shuts down Analytics.

This attribute should be used in "normal" exit conditions, preferably as close as possible to the point at which the application stops. Because the code indicated by this attribute is injected at the method's exit points, it may be placed on the same method as the SetupAttribute.

FeatureAttribute

Indicates that Dotfuscator should inject feature tracking code into the annotated method. The injected code will generate a feature message.

Note: Community Edition only supports up to 10 uses of the FeatureAttribute in a project. Professional Edition does not have this limitation.

  • Applies to: Method (multiple attributes on a single method permitted)

  • Prerequisites

  • Properties:

    • FeatureEventType: Required. The type of feature message to send:

      • Tick: The entry point of this method indicates a Feature Tick.

      • Start: The entry point of this method indicates the beginning of a Start/Stop Feature.

      • Stop: The exit points of this method indicate the end of a Start/Stop Feature.

    • Name: Required. The name of the feature.

ExceptionTrackAttribute

Indicates that Dotfuscator should inject code to report on unhandled exceptions occurring within the specified assembly or method.

When applied to an assembly, Dotfuscator injects handlers for the AppDomain.UnhandledException event and similar events. If invoked, these handlers generate a fault message.

When applied to a method, Dotfuscator injects code that catches any exception that would leave the method unhandled, generates a fault message, and then re-throws the exception with the original stack trace.

  • Applies to: Assembly (.exe only in Community Edition) or Method

  • Prerequisites

    • Build-time: A SetupAttribute on some method in some input assembly.

    • Runtime:

      • Analytics is set up (via a call to a method annotated with SetupAttribute)

      • The user did not opt-out. Depending on the Report Info gathered, the user may override their earlier setup-time opt-in preference for the exception report.

  • Properties:

    • ReportInfoSourceElement: Specifies a source containing user-specified information.

      • May be a IDictionary<string,string> or IDictionary Method Argument, Field, or Property; or a Method with the signature IDictionary<string,string>() or IDictionary().

      • If "DefaultAction", the injected code will use Dotfuscator's generic exception dialog.

      • If "None" (default), the injected code will obey the opt-in preference that was specified at setup-time.

    • ReportInfoSourceName: Specifies the name of that source.

    • ReportInfoSourceOwner: Specifies the declaring type of that source.

    • PrivacyPolicyUri: A URL to a privacy policy covering the transmission of exception reports, to be used in Dotfuscator's generic exception dialog.

      • If ReportInfoSourceElement is not "DefaultAction", this property is ignored.

InsertSignOfLifeAttribute

Indicates that Dotfuscator should inject code to report the application has been executed. The injected code generates a sign-of-life message.

A Shelf Life Activation Key is required to use this attribute.

Unlike other types of Analytics injection, this attribute's injected code does not honor the user's opt-in preference.

Dotfuscator Version 5.30.0.5167. Copyright © 2017 PreEmptive Solutions, LLC