Quick View of silverlight3 Beta: Package and download files (shared Assembly)

Source: Internet
Author: User

Translation: A quick look at Silverlight 3: Packaging Assemblies for Download

In Silverlight2, if a ancillary (additional) assembly (such as System. Xml. Linq. dll) is used)
You need to add a reference to it in. The generated XAP file includes the following content:

1. The assembly file of the current application
2. manifest file of the current application
3. Copy a System. Xml. Linq. dll file.

In this way, every time you download the application, they will also download the System. Xml. Linq. dll file. If you want to download other
If silverlight applications (also using System. Xml. Linq. dll) are used, these applications cannot benefit (SHARE.
In fact, this problem has already occurred in my application.

Note:System. Xml. Linq. dll is just an example. Many assemblies are widely used in silver
Light application.

In silverlight3, you can use Microsoft to download some assemblies files. The benefits are:

1. Reduce the size of your XAP File
2. You do not have to download the assembly files downloaded from other XAP instances again.

 

If your installation path is the same as mine:

C: \ program files \ microsoft sdks \ silverlight \ v3.0 \ libraries \ client

 

Search for the *. xml file and you will find some files named ". extmap. xml. For example:

"System. Xml. Linq. extmap. xml "

<? Xml version = "1.0"?>
<Manifest xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xmlns: xsd = "http://www.w3.org/2001/XMLSchema">
<Assembly>
<Name> System. Xml. Linq </name>
<Version> 2.0.5.0 </version>
<Publickeytoken> 31bf3856ad364e35 </publickeytoken>
<Relpath> System. Xml. Linq. dll </relpath>
<Extension downloadUri = "http://go.microsoft.com/fwlink? LinkId = 142576 "type =" regxph "text =" yourobjectname "/>
</Assembly>
</Manifest>

 

What this file does is provide a "Microsoft link", that is, from which the file can be downloaded to "System. Xml. Linq. dll ",
You do not need to provide the (xml) file in XAP.

If you install Silverlight3 Beta tools, a new option is displayed on the project properties page of,
As follows:

 

After this item is selected, you will see some changes in the generated program manifest. For example, reference System. Xml. Linq. dll:

<Deployment xmlns = "http://schemas.microsoft.com/client/2007/deployment" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly = "SilverlightApplication18" EntryPointType = "SilverlightApplication18.App" RuntimeVersion = "3.0.40307.0">
<Deployment. Parts>
<AssemblyPart x: Name = "SilverlightApplication18" Source = "SilverlightApplication18.dll"/>
<AssemblyPart x: Name = "System. Xml. Linq" Source = "System. Xml. Linq. dll"/>
</Deployment. Parts>
</Deployment>

 

After this option is selected:

<Deployment xmlns = "http://schemas.microsoft.com/client/2007/deployment" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly = "SilverlightApplication18" EntryPointType = "SilverlightApplication18.App" RuntimeVersion = "3.0.40307.0">
<Deployment. Parts>
<AssemblyPart x: Name = "SilverlightApplication18" Source = "SilverlightApplication18.dll"/>
</Deployment. Parts>
<Deployment. ExternalParts>
<ExtensionPart Source = "http://go.microsoft.com/fwlink? LinkId = 142576 "type =" regxph "text =" yourobjectname "/>
</Deployment. ExternalParts>
</Deployment>

 

When you run the application in a browser, the traffic (requests) under (using the fiddler tool) will be sent from my program.
To Microsoft.com:


 

To obtain the compressed file of System. Xml. Linq. dll.

Note:As far as I know, this situation is only valid for Microsoft assemblies.

 

Link: http://www.cnblogs.com/daizhj/archive/2009/03/26/1422408.html

Author: daizhj, Dai zhenjun

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.