重命名功能后无法升级解决方案

Can't upgrade solution after renaming feature

我目前正在使用 SPSD 为 Sharepoint 2013 项目开发部署解决方案。

与大多数项目一样,我们为项目的不同阶段保留了不同的版本。在我们的早期版本中,我们将一个功能命名为 "Definitions and WebParts",但后来我们决定取消 WebPart,因此我们将该功能重命名为 "Definitions".

现在,我遇到了一个问题,如果我只是升级解决方案,我会得到一个错误 "The solution cannot be deployed. The feature '' uses the directory '' in the solution. However, it is currently installed in the farm to the directory ''. Uninstall the existing feature before you install a new version of the solution."

所以我在升级功能之前禁用并卸载了它。虽然我不再得到以前的错误,但我现在得到一个新错误:"The solution file located at "" does not appear to be a valid upgrade for solution "".The two solutions must have the same resource types (global or Web-application scoped)."

有人知道这个错误是什么意思或我应该如何进行升级吗?

您好,我看到了这个博客,解释可能与您的情况相关 http://snahta.blogspot.com.au/2009/09/solution-file-located-at-xxxxwsp-does.html

原因: 这可能是由于功能范围发生变化或在解决方案包中从其先前版本中添加了新功能。

SharePoint 抱怨说该解决方案要么上次在全球部署,而这次您试图将其部署到特定 Url 或相反。

解决方法: 我会建议 retract/delete 旧解决方案和 add/deploy 新解决方案。

但以防万一您对这种方法有疑问,我建议比较解决方案包中的功能并将其移至另一个解决方案包。