This time, I got a chance to develop a Silverlight application. When I encountered a big problem with the xap package during the release, I went online for a long time and finally put Microsoft's document "how to use the application ". Program After reading the library cache for a long time, I finally figured out what it was saying. I was dizzy. It really took me the old saying "It's not difficult to come.
Finally, I decided to summarize this very simple thing to avoid wasting time on other new scholars.
Development scenario:
Silverlight application: interacts with the Web. Set Name: silverlightapplication10.dll
Silverlight Class Library: referenced by silverlightapplication10. Set Name: silverlightclasslibrary1.dll
Objectives:
In the compiled clientbin, The silverlightapplication10.xap package does not contain silverlightclasslibrary1.dll, And the silverlightclasslibrary1.dll exists independently in the new silverlightclasslibrary1.zip format.
OK. Now let's talk about this core trilogy:
1. In silverlighapplication10, the "Silverlight" label in the project property is checked with "reduce xap size by using application library Caching"
2. Add an extmap file "silverlightclasslibrary1.xml" to the location where the silverlightclasslibrary1.extmap. xml file is saved"
Content Description of silverlightclasslibrary1.extmap. xml
View sourceprint?
<Manifest xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" |
Xmlns: XSD = "http://www.w3.org/2001/XMLSchema"> |
<Name> silverlightclasslibrary1 </Name> |
<Version> 1.0.0.0 </version> |
<Publickeytoken> ee6c3f173c1a51b5 </publickeytoken> |
<Relpath> silverlightclasslibrary1.dll </relpath> |
<Extension downloaduri = "silverlightclasslibrary1.zip"/> |
Name: Assembly name of silverlightclasslibrary1
Version: assembly version.
Publickeytoken: Public Key after signature
There is nothing to explain. The Microsoft documentation "how to use the application library cache" clearly states. If you are not sure about version and publikeytoken, you can use the reflector command to check whether it is simple:
In addition, do not write an error in the content of extension downloaduri. It is the end of. Zip! I have a configuration for copy to. dll. I never succeeded. I thought I still need to set another configuration. I found it wrong only when I was killed.
3. silverlightapplication10 do not reference the silverlightclasslibrary1 project, but directly reference the compiled silverlightclasslibrary1.dll.
OK, the final result
Refreshing xap package! Change the secret name to silverlightapplication10.zip. Open it and see:
This site Article Except for the reprinted content, this site is original or translated. You are welcome to repost it in any form. However, please be sure to indicate the source and respect for others' labor achievements. Please note: The article is reprinted from: huide control network [http://www.evget.com/] address: http://www.evget.com/zh-CN/info/catalog/16004.html