I would like to share some of my basic understanding of Silverlight internals in this series.
XAP File
When you build a Silverlight 2.0 application, the final outcome would be:
ApplicationName.dll
AppManifest.xaml
ApplicationName.xap
When a request is made for a page which contains a Silverlight, the server sends the page with the Silverlight part as “xap” file to the client. The XAP is a normal archive file you use archive manager like 7-Zip to extract the content. It contains RequestSilverlightApp.dll and AppManifest.xaml. The silverlight CLR at the client side consumes these. This should be specified in either ASPX or HTML file which is the actual client requested page.
You use OBJECT tag along with DIV and IFRAME to load Silverlight host and specify the target XAP needs to be loaded.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
><meta equiv="Content-Type" content="text/html; charset=utf-8" />
</meta>
<meta name="ProgId" content="Word.Document" />
</meta>
<meta name="Generator" content="Microsoft Word 12" />
</meta>
<meta name="Originator" content="Microsoft Word 12" />
<link style="font-family: courier new;" rel="File-List" href="file:///C:%5CDOCUME%7E1%5CSHEIKM%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml" />
</link>
<link style="font-family: courier new;" rel="themeData" href="file:///C:%5CDOCUME%7E1%5CSHEIKM%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx" />
</link>
<link style="font-family: courier new;" rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CSHEIKM%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml" />
<!--[if gte mso 9]><xml> <w :worddocument> </w><w :view>Normal</w> <w :zoom>0</w> <w :trackmoves/> <w :trackformatting/> <w :punctuationkerning/> <w :validateagainstschemas/> <w :saveifxmlinvalid>false</w> <w :ignoremixedcontent>false</w> <w :alwaysshowplaceholdertext>false</w> <w :donotpromoteqf/> <w :lidthemeother>EN-US</w> <w :lidthemeasian>X-NONE</w> <w :lidthemecomplexscript>TA</w> <w :compatibility> <w :breakwrappedtables/> <w :snaptogridincell/> <w :wraptextwithpunct/> <w :useasianbreakrules/> <w :dontgrowautofit/> <w :splitpgbreakandparamark/> <w :dontvertaligncellwithsp/> <w :dontbreakconstrainedforcedtables/> <w :dontvertalignintxbx/> <w :word11kerningpairs/> <w :cachedcolbalance/> </w> <m :mathpr> </m><m :mathfont val="Cambria Math"> </m><m :brkbin val="before"> </m><m :brkbinsub val="--"> </m><m :smallfrac val="off"> <m :dispdef/> </m><m :lmargin val="0"> </m><m :rmargin val="0"> </m><m :defjc val="centerGroup"> </m><m :wrapindent val="1440"> </m><m :intlim val="subSup"> </m><m :narylim val="undOvr"> </m> </xml>< ![endif]-->
<!--[if gte mso 9]><xml> <w :latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"> </w><w :lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"> </w><w :lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 2"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 3"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 4"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 5"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 6"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 7"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 8"> </w><w :lsdexception locked="false" priority="9" qformat="true" name="heading 9"> </w><w :lsdexception locked="false" priority="39" name="toc 1"> </w><w :lsdexception locked="false" priority="39" name="toc 2"> </w><w :lsdexception locked="false" priority="39" name="toc 3"> </w><w :lsdexception locked="false" priority="39" name="toc 4"> </w><w :lsdexception locked="false" priority="39" name="toc 5"> </w><w :lsdexception locked="false" priority="39" name="toc 6"> </w><w :lsdexception locked="false" priority="39" name="toc 7"> </w><w :lsdexception locked="false" priority="39" name="toc 8"> </w><w :lsdexception locked="false" priority="39" name="toc 9"> </w><w :lsdexception locked="false" priority="35" qformat="true" name="caption"> </w><w :lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"> </w><w :lsdexception locked="false" priority="1" name="Default Paragraph Font"> </w><w :lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"> </w><w :lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"> </w><w :lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"> </w><w :lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"> </w><w :lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"> </w><w :lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"> </w><w :lsdexception locked="false" unhidewhenused="false" name="Revision"> </w><w :lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"> </w><w :lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"> </w><w :lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"> </w><w :lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"> </w><w :lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"> </w><w :lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"> </w><w :lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"> </w><w :lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"> </w><w :lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"> </w><w :lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"> </w><w :lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"> </w><w :lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"> </w><w :lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"> </w><w :lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"> </w><w :lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"> </w><w :lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"> </w><w :lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"> </w><w :lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"> </w><w :lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"> </w><w :lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"> </w><w :lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"> </w><w :lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"> </w><w :lsdexception locked="false" priority="37" name="Bibliography"> </w><w :lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"> </w> </xml>< ![endif]-->
<!--[if gte mso 10]> < ![endif]-->
<span style="font-family:courier new;"><object data="data:application/x-silverlight,"
type="application/x-silverlight-2" width="100%" height="100%"></span>
<span style="font-family:courier new;"><param name="source" value="HelloSilverApp.xap"/></span>
</link></meta>
In your ASPX, you can use ASP.NET server side control to specify Silverlight host and specify the target XAP. In the above declaration, the XAP file has been specified in the “source” parameter.
1
2
3
4
5
><span style="font-family:courier new;"><asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/HelloSilverApp.xap" MinimumVersion="2.0.31005.0"
Width="100%" Height="100%" /></span>
In the above declaratin, the XAP file has been specified in the “Source” attribute.