views:

298

answers:

4

Is there any way to get the code from a silverlight publish? My laptop has completely crashed, the only thing if have left from my application, is the published website. Is there a tool or something to get the code from my app?

+7  A: 

You can rename the xap to zip, extract it, and use Reflector to pull out the code. It won't recover it exactly or recover the XAML though. As far as I know there's no way to reverse engineer XAML.

Edit: +1 for Shawn for pointing out that the XAML is stored as plaintext resources, so you can recover that too. Not quite sure why it does that, but hey, it's good news :-)

Steven Robbins
+2  A: 

try Silverlight spy. It's a great tool for debugging Silverlight. If you use it in combination with reflector you can view the decompiled code of any running silverlight application.

Btw, here are all features of silverlight spy

Sorskoot
how can i import my dll's or xap file in silverlight spy?
Jordy
you can browse to the url where your app is running with silverlight spy, and it will find the xap file.
Sorskoot
That's allready fixed, but where is the option to decompile my xap-file?
Jordy
In the explorer panel you can look at the contents of a xap file. after you've selected a dll. goto the view tab on the view panel. You have to have reflector installed.
Sorskoot
+4  A: 

Using reflector you can can all the xaml. Its stored as resources in plain text.

Shawn Wildermuth
where do you find those xaml-files??
Jordy
Look at the Resource folder at the bottom of the assembly, and it will have the namespace it in. I you click it you'll see the XAML.
Shawn Wildermuth
A: 

Thanks Shawn..you strike me Gold...

biju