Decompile a Silverlight Project

Source: Internet
Author: User
Tags reflector silverlight

On the Internet, there are a lot of Silverlight projects released every day, some open source, some just to show. In the early days of Silverlight learning, most of them had to imitate learning, so it was best to find a Silverlight project that could see the source code. However, Silverlight publishes only the resource bundle XAP, and all the resources are in this XAP file, how do you see the resources and code in it? Below I will demonstrate the method of anti-compilation, which I will use silverlight.net home Silverlight as an example.

1. First open the Silverlight.net, the page contains a Silverlight navigation animation;

2. In the browser, click on the right button to view the page source code;

3. Searching the "XAP" in the HTML source code will quickly locate the XAP.

We see <param name= "Source" value= "Clientbin/showcasenav/showcasenav.xap"/>

This value is the location of the XAP on the server side.

4. We use the same domain name to obtain the current XAP file. Open a new browser, enter in the Address bar: http://www.silverlight.net/clientBin/showcasenav/ShowcaseNav.xap

The browser will then prompt you to download the XAP file.

5. Rename the downloaded file showcasenav.xap, for Showcasenav.zip. Then unzip the package into the same directory. In the catalog, you see the assembly order files that Silverlight uses, as well as class libraries, and configuration files.

6. Below you can use the familiar anti-compilation software, reflector to view the resources and code files in the DLL. Click to download Reflector

7. Double-click "MsCommunities.Silverlight.ShowcaseNav" in reflector, expand the file to see the DLL and resources, Where resources contain all of these XAML files and picture files, the DLL is the class library backend code.

8. Click to enter the Reources directory, double-click "Mscommunities.silverlight.showcasenav.g.resources", on the right side of reflector can see the list of resources, select any one want to view the code of the file, Right-click "Save as" to save to local, you can use VS2008 or text editing software to view the contents of the code.

9. Corresponding to each resource file will have the class library code, double-click "MsCommunities.Silverlight.ShowcaseNav.dll", and then double-click "MsCommunities.Silverlight.ShowcaseNav", You can view each class library file, where we check "Itemadvancecontrol" and see the Anti-compilation code on the right side of reflector.

Now that we've talked about how to decompile a Silverlight project and see its source code, I'd like to introduce a foreign shareware that can also achieve the same effect as above-Silverlight spy,:http://silverlightspy.com/ silverlightspy/download-silverlight-spy/

Silverlight Spy is a shareware software that automatically obtains a XAP file to help you resolve files in the XAP, and the software and reflector mates can also view the Silverlight project source code. At the same time, you can break down the styles and UI in your project, and isolated storege to developers. We enter the Silverlight.net address in the Address bar, you can get, double-click any resource, in the view window can be viewed.

Decompile a Silverlight Project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.