Red Gate forums :: View topic - Struggling to use SmartAssembly with Silverlight XAPs
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Struggling to use SmartAssembly with Silverlight XAPs

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
phaedrus30



Joined: 25 Jan 2013
Posts: 6

PostPosted: Fri Jan 25, 2013 6:53 am    Post subject: Struggling to use SmartAssembly with Silverlight XAPs Reply with quote

Hi I'm trialling SmartAssembly 6.7 at the moment, and trying to work out how to get a group of Silverlight XAP files to obfuscate correctly.

The architecture of the files is as follows (PRISM style):

There is a shell module XAP that also includes all the dependencies of the application, including an infrastructure DLL and a framework DLL (which is code shared with the server application).

There is also a XAP for each application module (currently 6), these do not include any dependencies.

I can get the shell XAP obfuscated pretty well, the only change I needed to make was to exclude views that were loaded directly via reflection, which is fine.

However, I also need to obfuscate the infrastructure and framework DLLs that are in this XAP as well. As soon as I merged the DLLs, without any other processing, the application crashes to the white screen of death immediately after loading.

I simply can't progress here because I have no idea what's failing - the codebase I'm working with is huge so I can't just randomly exclude things from obfuscation and hope for the best.

Is there any way that I can diagnose what is causing the application to break?

The other alternative I'm going to try is a separate SA project for each assembly, then use the embed dependencies option instead of merging, so that I can still get the assemblies obfuscated.

Any advice appreciated - at this stage it's not looking like we will be able to use this product.
Back to top
View user's profile Send private message
phaedrus30



Joined: 25 Jan 2013
Posts: 6

PostPosted: Fri Jan 25, 2013 7:25 am    Post subject: Reply with quote

Also, I can't obfuscate any of the module XAPs either, I get the message "'XXX' is not a valid .NET assembly" whenever I try to open the source XAP.

These modules are PRISM modules, meaning they just compile the project DLL into the XAP, and references are all set to Copy Local=False, which is the standard pattern.

This is a bit of a show-stopper, if I can't even open module XAPs. Is anyone aware of this issue?
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Mon Jan 28, 2013 1:53 pm    Post subject: Reply with quote

Sorry you're having trouble getting this working.

Silverlight can indeed be a little more troublesome to get working but it should be possible.
For the crash, have you tried "rebuild with diagnostics"? This may give you a useful stack trace when it crashes to help point to the part that's going wrong.

For the other .xap files where it says it's not a valid assembly, you can read about how SA processes these here - if you check the Manifest points to the right file, can you extract that and see if SA can process the DLL on its own? If you get the same message, has the DLL been postprocessed by some other tool at all?
Back to top
View user's profile Send private message
phaedrus30



Joined: 25 Jan 2013
Posts: 6

PostPosted: Tue Jan 29, 2013 2:08 am    Post subject: Reply with quote

Thanks for the reply. I think I know why the modules are failing to open in SmartAssembly - the assembly entry point is not specified.

I added App.xaml to all of the modules, and set it as the entry point in the project properties. This allowed the assembly to be loaded in SA.

When prompted for dependencies, I added a new search folder to the shell output folder, which works well and should translate across servers using relative paths.

The remaining step was to exclude views loaded by reflection - haven't found any other problems so far although my testing is not exhaustive.

So I have a working solution for now. Thanks for your help!
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1119
Location: My desk.

PostPosted: Tue Jan 29, 2013 1:11 pm    Post subject: Reply with quote

Cool - glad to hear you're making progress!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group