.net Silverlight:如何处理标准组件(第2部分)
有必要将“标准”程序集移出xap文件(Silverlight 4应用程序)。我有一个类似的问题(),并得到了一个很好的链接和深入的解释。但并不是所有的事情都清楚 在我打开“使用应用程序库缓存减少XAP大小”后,我的XAP文件大小在两次内减小,以下程序集被移出到单独的zip文件中:.net Silverlight:如何处理标准组件(第2部分),.net,silverlight,silverlight-4.0,xap,.net,Silverlight,Silverlight 4.0,Xap,有必要将“标准”程序集移出xap文件(Silverlight 4应用程序)。我有一个类似的问题(),并得到了一个很好的链接和深入的解释。但并不是所有的事情都清楚 在我打开“使用应用程序库缓存减少XAP大小”后,我的XAP文件大小在两次内减小,以下程序集被移出到单独的zip文件中: System.ComponentModel.DataAnnotations System.Windows.Controls System.Windows.Controls.Data System.Windows.Co
- System.ComponentModel.DataAnnotations
- System.Windows.Controls
- System.Windows.Controls.Data
- System.Windows.Controls.Data.Input
- System.Windows.Controls.Input
- System.Windows.Controls.Navigation
- System.Windows.Controls.Toolkit
- System.Windows.Data
- GalaSoft.MvvmLight.SL4
- Microsoft.Practices.ServiceLocation
- Microsoft.Practices.Unity.Silverlight
- System.Windows.Controls.Toolkit.Internals
- Q1.上述组件之间有什么区别
- 问题2.如何将这4个程序集也移动到单独的zip文件中
<?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.Windows.Data</name>
<version>2.0.5.0</version>
<publickeytoken>31bf3856ad364e35</publickeytoken>
<relpath>System.Windows.Data.dll</relpath>
<extension downloadUri="System.Windows.Data.zip" />
</assembly>
</manifest>
,您将看到这是如何构建的。大多数部分应该是显而易见的,唯一不寻常的方面是潜在的扩展元素。通过在downloadUri属性中添加文件名,程序集将自动打包到该文件中(它是一个zip文件,但扩展名可以是您想要的任何内容)
引用程序集(如System.Windows.Data)时,它会发现此文件,并在生成过程中使用它创建zip文件System.Windows.Data.zip。如果两个或多个引用的程序集共享相同的下载URI目标文件名,则它们将在生成时自动合并到单个文件中
A2)
您可以按照该模式为第二个列表中的每个程序集创建*.extmap.dll文件
xml文件应与要创建的程序集位于同一文件夹中
对于GalaSoft.MvvmLight.SL4(例如,我没有安装此组件,也不知道它是否已签名)。该文件将命名为:
GalaSoft.MvvmLight.SL4.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>GalaSoft.MvvmLight.SL4</name>
<version>#.#.#.#</version> <!-- needs the version number -->
<!-- if there's a public key token, put it in this element, and
uncomment it -->
<!-- <publickeytoken></publickeytoken> -->
<relpath>GalaSoft.MvvmLight.SL4.dll</relpath>
<extension downloadUri="GalaSoft.MvvmLight.SL4.zip" />
</assembly>
</manifest>
GalaSoft.MvvmLight.SL4
#.#.#.#
GalaSoft.MvvmLight.SL4.dll
一旦该文件存在,Visual Studio将使用它构建一个名为GalaSoft.MvvmLight.SL4.zip的zip文件。一旦引用dll(只要extmap.xll文件与原始程序集并排),所有这些都会自动发生。非常感谢!