Decompile the Silverlight Project

Source: Internet
Author: User
Keywords View compile can see
Tags .net address address bar browser bundle class click code

On the Internet, there are many Silverlight projects released every day, some open source, some just for demonstration. In the early days of Silverlight learning, most of them need to imitate learning, so it is best to discover a Silverlight project that can view the source code. However, Silverlight Publishing is just publishing the resource bundle XAP, and all the resources are in this XAP file, how do you view the resources and code? I'll show you how to decompile this, and I'll use silverlight.net home Silverlight as an example in the demo.

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

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

3. Search for "XAP" in the HTML source code and quickly locate the XAP position.

We see <param name= "Source" value= "Clientbin/showcasenav/showcasenav.xap"/>, which is the location of the XAP on the server side.

4. We use the same domain name to get the current XAP file. Open a new browser, enter in the Address bar: HTTP://WWW.SILVERLIGHT.NET/CLIENTBIN/SHOWCASENAV/SHOWCASENAV.XAP, the browser will prompt you to download the XAP file.

5. Rename the downloaded file showcasenav.xap for showcasenav.zip. Then unzip the compressed package to the same directory. In the table of contents, you will see the assembly slip files that the Silverlight uses, as well as class libraries, and configuration files.

6. You can use the reflector software that you are familiar with to see the resources and code files in your DLL. Download reflector:http://www.red-gate.com/products/reflector/.

7. In Reflector, double-click "MsCommunities.Silverlight.ShowcaseNav" to expand the file to see the DLL and resources, where resources contains all the XAML files and picture files. DLL is a class library background code.

8. Click to enter the Reources directory, double-click "Mscommunities.silverlight.showcasenav.g.resources", in the reflector to the right you can see the list of resources, select any one want to see the code file, Click "Save As" and save it locally to view the code content using VS2008 or text-editing software.

9. Corresponding to each resource file will have class library code, double-click "MsCommunities.Silverlight.ShowcaseNav.dll", and then double-click "MsCommunities.Silverlight.ShowcaseNav", Can view the various class library files, here, we select "Itemadvancecontrol", the reflector to the right to see the decompile code.

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

Silverlight Spy is a shareware that automatically obtains XAP files to help you parse the files in Xap, which can also view Silverlight project source code with reflector. At the same time, you can break down the styles and UI in your project, as well as isolated storege to developers. We enter Silverlight.net address in the Address bar, you can get, double-click any one of the resources, in the View window to view.

Related Article

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.