Dotfuscator Quick Start Guide

XAML Considerations

XAML Rewriting

Dotfuscator parses and updates:

  • Binding Markup Extensions, if the base property in the expression belongs to a class in the XML hierarchy above that node.
    • Example: <Textbox Text="{Binding Path='Dealership.SalesTeam'}">
  • Element names, if we determine it is backed by a class we can find in the input (based on the namespace).
    • If we can find a match, then we also rewrite attributes/children nodes appropriately.

XAML Rewriting Limitations

Dotfuscator does not handle:

  • Actual XML namespaces
  • We try to update things in templates/styles, but we may do so incorrectly. It is typically better to just exclude properties and types referenced from templates/styles.
  • Attached properties/events
    • We do not update the backing field, methods, and registered name for XAML references.

Best Practices

Manually exclude:

  • All attached properties and events.
  • All backing fields and registered methods of attached properties and events.
    • Look for fields of type System.Windows.DependencyProperty.
    • Look for methods that have any parameter of type System.Windows.DependencyObject.
      • Unfortunately, a custom rule cannot be made to support this in the current version, so all instances must be found manually.
  • All properties referenced from templates/styles (and potentially all other properties in the input with the same literal name).

XAML Build Warnings

In most situations when Dotfuscator analyzes a piece of XAML and cannot match it up with a CLR object, it will issue a warning to notify users they will need to make a manual change. It is important that warnings be checked when trying to determine the cause of runtime failures.

Dotfuscator Version 4.28.0.4985. Copyright © 2017 PreEmptive Solutions, LLC