版本 SharePoint WSP

发布于 2024-09-01 17:20:48 字数 57 浏览 3 评论 0原文

有人尝试过在 SharePoint 2010 中对 WSP 进行版本控制吗?

谢谢,

Has any one tried to version WSP in SharePoint 2010?

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

最笨的告白 2024-09-08 17:20:48

在您的问题中更具体地说明“.wsp”会有所帮助。

正如 Flo 提到的 - 如果您保持程序集版本相同但更改 AssemblyFileVersion,则可以使用

STSADM -o Upgradesolution ...

请参阅我的答案 SO - 我如何使用通配符程序集版本控制?

这对于 Web 部件来说已经足够了,但是如果您有其他工件并且正在使用诸如功能之类的东西事件接收器,那么您可能必须撤回并重新部署。

It would help to be a bit more specific that ".wsp" in your question.

As Flo mentioned - if you keep the assembly version the same but change the AssemblyFileVersion then you can upgrade the assemblies in your WSP solution using

STSADM -o upgradesolution ...

See my answer on SO - How can I use wildcard assembly versioning?

This will suffice for webparts but if you've got other artifacts and are using things like Feature things like event receivers then you may have to retract and re-deploy.

情归归情 2024-09-08 17:20:48

感谢大家的回复。我有两个担忧

:假设我的 wsp 正在部署一个程序集版本为 1.0.0.0 的 Webpart,程序集文件版本也是 1.0.0.0。现在几天后我需要部署最新版本的 webpart。现在程序集版本将为 2.0.0.0,程序集文件版本也将为 2.0.0.0。我注意到,即使我撤回并重新部署 wsp,位于 Web 部件库中的 .webpart 文件始终将程序集版本显示为 1.0.0.0。我猜这是因为 wsp 撤回不会删除 .webpart 文件,也不会停用功能。因此,剩下的唯一选择是编写功能停用代码以从 Webpart 库中删除 .webpart 文件。这在很大程度上是低效的,因为我需要迭代已部署的 Web 应用程序的所有网站集,以确定从代码(Windows 窗体作为安装程序)激活和停用该功能的网站集。

b.我需要查询 webpart dll 版本以进行某些操作。我想如果我们可以对 wsp 进行版本控制并保持 wsp 版本与 Web 部件 dll 相同,那就太好了。这将帮助我保留在 SharePoint 上下文中以确定 Web 部件 dll 版本(而不是查询 dll 来查找版本)。

谢谢

Thanks all for your replies. I have two concerns:

a. Assume my wsp is deploying a webpart with assembly version as 1.0.0.0 and assembly file version is also 1.0.0.0. Now after few days i need to deploy a recent version of webpart. The assembly version now will be 2.0.0.0 and assembly file version will also be 2.0.0.0. I have noticed that even if i retract and redeploy the wsp, the .webpart files that sits in the web part gallery always shows assembly version as 1.0.0.0. I guess this is because wsp retraction will not delete the .webpart file and neither feature deactivation. So the only option that remains is to write feature deactivation code to delete the .webpart file from webpart gallery. This will be largely in efficient as i will need to iterate through all the site collections of deployed webapplication to determine from the code ( a windows form as installer) the site collection where feature is activated and deactivate the same.

b. I need to query the webpart dll version for some operation. I was thinking it will be good if we can version wsp and keep the wsp version same as the web part dll. This will help me to remain in the SharePoint context to determine the web part dll version ( rather than querying the dll to find the version).

Thanks

沫尐诺 2024-09-08 17:20:48

WSP 没有真正的版本。
但是,您可以将组件版本化到其中:

  • 通过不同名称(FeatureV1、FeatureV2...)的功能或 WebPart
  • 使用标准程序集版本控制的程序集(WebpartV1 使用程序集 1.0.0,WebPartV2 使用 1.1.0 等)
  • ...

WSP don't really version.
You can however version components into it:

  • Feature or WebParts via different names (FeatureV1, FeatureV2...)
  • Assembly using standard assembly versioning (WebpartV1 use assembly 1.0.0, WebPartV2 use 1.1.0 and so on)
  • ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文