Generic Interfaces, Dotfuscator CE, VerificationException

Never do these together:
  • Add multiple (at least 2) overloaded methods, like in this code example:
    Check(IDictionary<KeyType1, ValueType>) {…}
    Check(IDictionary<KeyType2, ValueType>) {…}
  • Obfuscate your generated assembly with the Dotfuscator Community Edition from Visual Studio 2005
  • Host a Windows Forms control from the obfuscated assembly in Internet Explorer.

Doing all those, you will have a very hard time debugging a VerificationException that will occur because Dotfuscator CE has a bug! It doesn’t treat well the overloaded methods, and generate incorrect MSIL code! To verify, you could use PeVerify tool from .NET Framework SDK. It will tell you that there is an error in the obfuscated DLL (although if you run the same test against your original DLL, the one before obfucation you don’t find any error).

Hope it helps someone!

About Sorin Dolha

My passion is software development, but I also like physics.
This entry was posted in Computers and Internet. Bookmark the permalink.

Add a reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s