Showing posts with label wpf. Show all posts
Showing posts with label wpf. Show all posts

Thursday, January 06, 2011

How to fix Eazfuscator.NET unhandled exception error in WPF?

Today, I wanted to obfuscate one of the WPF applications that we are planing to deploy soon. While
googling I found this grate open source product Eazfuscator.NET and I downloaded the latest beat version and gave it a try.

After the obfuscating process completed I ran the .exe file to check whether everything is working as it suppose to but it didn't and I got this exception instead.

"Description: The process was terminated due to an unhandled exception. Exception Info: System.Windows.Markup.XamlParseException"

Now confused. I had no idea how to fix it ! googled it again and got nothing! So i decided to play around it and see.

1. Create a separate window. set it as the start-up Url in App.xaml file Eg,
StartupUri="DummyWindow.xaml"

2. If it's working, which it did for me.

3. Try looking at the MainWindow.xaml event bindings with the MainWindow.xaml.cs file.

most if the time, when it obfuscates, it will obfuscates events as well, If you have any events Like
Window_Loaded make sure they are not being obfuscated using the flag

[System.Reflection.Obfuscation(Exclude = true)]

Eg.

[System.Reflection.Obfuscation(Exclude = true)] private void Window_Loaded(object sender, RoutedEventArgs e) {

}


4. Open the VS 2010 editor, Change it to release mode and rebuild.

you should see a message like,

Obfuscating assembly 'xxxxx.exe'...

then run, You should get an error message if you have any problems starting up which should be easy to diagnose.

Hope this will help someone. Eazfuscator.NET is a grate free product and I hope it will stay that way !


Monday, December 13, 2010

why 'EasingDoubleKeyFrame' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.

if you get this error that means you are trying to use a WPF4 feature in 3.5

easyway out is to change it to change it to SplineDoubleKeyFrame

how to solve The attachable property 'VisualStateGroups' was not found in type 'VisualStateManager'. exception in VS2008

No need to move to VS2010 to solve this problem,

just have to install these two patches to get the VisualStateGroups in XAML view

http://code.msdn.microsoft.com/KB958017/Release/ProjectReleases.aspx?ReleaseId=1719
http://code.msdn.microsoft.com/KB958017/Release/ProjectReleases.aspx?ReleaseId=1719

then it works like a magic.