Page 1 of 1

Reflection WPF .net

Posted: Mon Apr 02, 2012 4:12 pm
by groupThink
When protected my WPF .net application crashes on this line:

Code: Select all

XmlSerializer x = new XmlSerializer(p.GetType());
Is that because Enigma obfuscates the code and reflection doesn't work ? That said

Code: Select all

MessageBox.Show(p.GetType().ToString());
Shows the expected type name

Cheers,

Chris.

Re: Reflection WPF .net

Posted: Tue Apr 03, 2012 6:55 am
by Enigma
Hi Chris,

This can be fixed by generating the serialisers using sgen.exe as a Post Build Event

“$(FrameworkSDKDir)\Bin\sgen” /a:"$(TargetPath)" /force

It generates a dll ({ProjectName}.XmlSerializers.dll) that makes it work. It can be included in the Virtual Box then.

Re: Reflection WPF .net

Posted: Wed Apr 04, 2012 11:49 am
by groupThink
That's it thanks.

Note 64 bit and .net 4.0 users will need to use the correct path:

Code: Select all

“$(FrameworkSDKDir)\Bin\NETFX 4.0 Tools\sgen” /a:"$(TargetPath)" /force

Re: Reflection WPF .net

Posted: Wed Apr 04, 2012 12:01 pm
by Enigma
Yes, thanks you for the addition!

Re: Reflection WPF .net

Posted: Wed May 16, 2012 3:59 am
by sanyock
Is it allowed to disable obfuscation of a .NET assembly if using 3rd party obfuscator?
Btw, is obfuscation feature missing from the demo?

Re: Reflection WPF .net

Posted: Wed May 16, 2012 10:34 am
by Enigma
Enigma Protector does not allow to obfuscate .net code, so it is even recommended to use some obfuscator before protection.
As per experience, there was not reported any incompatibility of Enigma Protector with any 3rd obfuscation tools.