Problem while obfuscation of silverlight .xap
anand.mohan
Posts: 6
Hi,
I have some issues regarding obfuscating silverlight .xap.
actually in my project there are few third party dlls have been used, so when i am trying to obfuscate my project's xap then after obfuscation when i am hosting it gets blank.
While doing workaround for it I made the replica of that project and when i had excluded the user-control in which the T-Chart dll had been used then its working fine. But here is some more problem that in my project there are some modules in which there is some code parts and also it consists of TChart's dll.
For this I had go through some topics present on the forum where i found that using Custom Attributes we can exclude that code which we don't want to obfuscate but the problem remains same.
Plz. help in this matter.
I have some issues regarding obfuscating silverlight .xap.
actually in my project there are few third party dlls have been used, so when i am trying to obfuscate my project's xap then after obfuscation when i am hosting it gets blank.
While doing workaround for it I made the replica of that project and when i had excluded the user-control in which the T-Chart dll had been used then its working fine. But here is some more problem that in my project there are some modules in which there is some code parts and also it consists of TChart's dll.
For this I had go through some topics present on the forum where i found that using Custom Attributes we can exclude that code which we don't want to obfuscate but the problem remains same.
Plz. help in this matter.
Anand Mohan
Comments
please reply me as soon as possible its very urgent...
Thanks:
Could you kindly try turning on error reporting to see if you can get more details about what parts of code might need to be excluded?
Also can you please check--if you run your application through SmartAssembly with all features turned off, does your application still crash/throw errors?
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
" Failed to assign to property 'System.Windows.Controls.Primitives.ButtonBase.Click'. "
My application is running fine if i run my application through SmartAssembly with all features turned off.
I had excluded some of the Namespaces which contained third party dll after that i got success in running my application but now the problem is that the child-windows are not getting popped-up and one of my application's page which reads an .xml file using WCF.RIA services, is not getting executed.
Thanks & Regards:
One thing to make sure of: is every member called on by reflection from your XAML files excluded from obfuscation? SmartAssembly will automatically exclude some things from obfuscation to make sure your xaml file still works with your application, but sometimes you may need to manually exclude anything it missed.
Pruning might also be an issue (if so, you can use the DoNotPrune attribute to exclude any types in question from pruning ). Are you using this feature by any chance?
Also, just to confirm, did those exclusions you added resolve the "failed to assign to property" error? If not, it sounds like there is an event handler that you'll need to exclude from obfuscation (http://stackoverflow.com/questions/5482 ... ilverlight)
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
It is running fine without obfuscation but after obfuscation its not getting popped-up. Please look into this,
XAML,
Thanks & Regards:
When they are obfuscated, they no longer can be found by the original names they are referenced by in the XAML. This is what causes the "failed to assign to property" error.
You can either add the exclusion from the SmartAssembly UI or by using the custom attributes - http://www.red-gate.com/supportcenter/c ... Attributes
I hope that helps! Please give it a try and let me know if there are any further issues.
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
It worked for me, now my application is running fine after obfuscating the xap. But still there is an issue present that when i am reflecting the obfuscated xap then the variables & fields are still present with their real names.
Plz. look into this so that i will be able to fully obfuscate my xap which will increase its reliability in terms of code protection.
Thanks & Regards:
The following types are always excluded from obfuscation to ensure that your application works correctly:
-Public members of DLLs
-Types with the Serializable attribute.
-Types with a base class of System.MulticastDelegate.
-Types with System.ServiceModel.OperationContractAttribute specified.
-Types with System.ServiceModel.ServiceContractAttribute specified.
-Types with any attribute starting System.Xml.Serialization.
-Methods with System.Reflection.DefaultMemberAttribute specified.
Also..
-Enums are normally obfuscated, but SmartAssembly assumes that enum values which have Format, GetName, GetNames, Parse, or ToString called on them will be displayed to users. These enums are therefore excluded from obfuscation automatically.
-If a member name is the same in one more than one class, the member names might not be renamed. To ensure that they are renamed, under Obfuscation, select the Advanced renaming fields name mangling option.
(Note that selecting Advanced renaming prevents Decode Stack Trace from retrieving the names of the original fields.)
To see why SmartAssembly has not obfuscated your code, you can create a log file in 'TRACE' mode. For more information, see Log file for SmartAssembly.
Hope this information helps!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?