Struggling to use SmartAssembly with Silverlight XAPs

phaedrus30phaedrus30 Posts: 9
edited January 29, 2013 7:11AM in SmartAssembly
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.

Comments

  • 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?
  • 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?
    Systems Software Engineer

    Redgate Software

  • 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!
  • Cool - glad to hear you're making progress!
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.