我该如何缩小尺寸

我该如何缩小尺寸

本文介绍了我的.XAP文件太大吗?如果是的话,我该如何缩小尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为我写给客户的Silverlight LOB应用程序上做一些工作.

I'm currently doing some work on a silverlight LOB application i wrote for a customer..

当我部署时,我不禁注意到xap文件有多大(4mb),并考虑到它不是一个庞大的应用程序,这似乎有点不寻常.

When i deploy i can't help noticing how big the xap file is (4mb) and considering it's not a massive app it seems a little unusual.

我正在使用telerik silverlight工具包(但仅包括必需的主题-我认为是2个.)

I am using the telerik silverlight toolkit (but only including the required themes - 2 I think)..

大约有1mb的图像(对于LOB应用程序来说可能有点太多了.)

There's about 1mb of images (which is maybe a bit too much for a LOB app)..

这是Silverlight应用程序的平均值吗?

Is this average for a silverlight application?

xap文件的平均大小是多少?

Whats the average size of your xap files?

我该如何缩小"或压缩xap文件?

How would I go about "minifying" or compressing my xap file?

推荐答案

如果使用7-Zip之类的存档读取器打开.xap文件,或者将其重命名为.zip并将其打开,则可以了解到哪里大小来自.

If you open the .xap file with an archive reader like 7-Zip, or rename it to .zip and open it, you can get an idea of where the size is coming from.

您可以通过删除所有未使用的引用来减小文件的大小.如果不确定是否使用了某些工具,请将其删除,然后查看该应用是否仍在构建.如果没有,请放回原处.

You can cut down on the size of the file by removing any References that aren't used. If you're not sure if something is used or not, remove it and see if the app still builds. If not, put it back in.

在您的Silverlight项目的属性"的"Silverlight"部分中,可以选中通过使用应用程序库缓存来减少XAP大小"复选框,以使其将某些DLL移出到单独的.zip文件中,而不是将其包含在XAP中.这样,如果您的应用程序发生了更改,则您的用户不必再次下载包含的DLL的所有全部.

In your Silverlight project's Properties, in the Silverlight section, you can check the "Reduce XAP size by using application library caching" checkbox to have it move some of the DLLs out to separate .zip files instead of being included in the XAP. That way, if your app changes, your users don't have to download all of the included DLLs again.

如果仍然太大而无法满足您的口味,则可能需要考虑将图像移出.xap文件.

If it's still too large for your tastes, you might want to look at moving the images out of the .xap file.

这篇关于我的.XAP文件太大吗?如果是的话,我该如何缩小尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 18:50