Dotfuscator User's Guide
Exit Point Attributes

To prepare an application for analytics, the developer must identify appropriate exit methods. The developer then must add Teardown attributes to the exit methods. When Dotfuscator encounters a Teardown attribute during its processing, it adds analytics cleanup code to the end of the exit method. Teardown attributes are not required at runtime; therefore, Dotfuscator strips them from the output application after it adds the cleanup code.

An exit method is a method in the application that is executed as part of the application's shutdown sequence. It does not necessarily have to be the last method called, but it should have the property that it is executed exactly once when the application shuts down.

It is possible for the same method to be both an entry point and an exit method (for example, the Main method in a console application).

Example exit methods for different application types:


Application Type Possible Exit Method
Console Application Main or method always called from Main
Windows Forms Application Main Form’s constructor
Windows Forms Application Main Form's Dispose method
Windows Forms Application Main Form's OnClosed event handler


The Teardown attribute has no required arguments or properties, so it is simple to use:

Teardown Attribute
Copy Code
private void MyExitMethod() { ... }



© 2016 PreEmptive Solutions, LLC. All Rights Reserved.