每个构建的 wsp 文件大小不同
我有一个在 VS.net 2008 中运行的 SharePoint 项目。每次使用 WSP 生成器生成 wsp 时,wsp 文件总是具有不同的大小。构建之间没有任何改变。所有机器上都会发生这种情况。
我想知道这背后的原因是什么?和文件的打包方式有关系吗?
谢谢。
更新
以下是我为解决此问题而执行的步骤:
- -build project.
- -build wsp file.
- -check wsp file size.
- -delete wsp file.
在同一个项目上重复 n 次。
wsp文件大小的变化不超过100字节。但是,如果我在同一台机器上使用相同的工具构建相同的项目,我会认为 wsp 文件每次都会出现相同的大小。
更多更新 我使用文件比较工具对 2 个 wps 文件进行了文件比较(将 wsp 文件重命名为 cabs 并提取文件后)。有两个区别:一个在 DLL 文件中(我无法读取其所有乱码),另一个在清单文件中(只是构建时间的差异)。
文件大小方面,所有文件大小都匹配。可能是哈希的事情?
I have a SharePoint project running in VS.net 2008. Each time when I build the wsp using WSP builder, the wsp file always turns out to be of different size. Nothing was changed between builds. This happens on all machines.
I was wondering what could be the reason behind it? Does it have something to do with the way the files were packaged?
Thanks.
UPDATE
Below are the steps I performed to get this issue:
- -build project.
- -build wsp file.
- -check wsp file size.
- -delete wsp file.
Repeat that for n times on the same project.
The variation of wsp file size is no more than 100 bytes. But if I build the same project using the same tool on the same machine, I would thought that the wsp file to come out the same size each time.
More update
I have done a file comparison between 2 wps files using a file diff tool (after renaming the wsp files into cabs and extracting the files). There are 2 differences: one in the DLL file (which I can't read its all gibberish), and the other one in manifest file (just a difference in the time of build).
File size wise, all file sizes match up. Might have been a hashing thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是由 Visual Studio 增加每个版本的版本号引起的。由于 cab 压缩,这又导致 wsp 文件大小不同。
检查 Properties/AssemblyInfo.cs,将版本属性从 1.0.0.* 更改为静态值 (1.0.0.0)
It might be caused by visual studio incrementing the version number each build. Which in turn leads to a different wsp file size because of the cab compression.
Check the Properties/AssemblyInfo.cs, change the version attribute from 1.0.0.* to something static (1.0.0.0)