自定义站点列无法更新
我在 Visual Studio 2010 中为我的 SharePoint 2010 项目创建了一个 ContentType,第一次通过 WSPBuilder 部署 wsp 时没有遇到任何问题,但现在每次我尝试部署时,它总是说它无法激活功能,因为“ 在功能中定义 ID {在此处插入随机 guid} 的字段在当前网站集或子网站中找到了 {60938308-3563-497c-bc55-b2ae847ca8b8}(在网站上激活我的内容类型的功能)。”
内容类型和网站列在 rootweb 上创建,即使我尝试停用该功能或完全卸载它,网站列和内容类型也不会从 ContentType 库或网站中删除专栏画廊。
怎么会这样呢?
我使用纯功能和 XML 功能。不涉及事件接收者。
I have made a ContentType in Visual Studio 2010 for my SharePoint 2010 project and the first time I deployed the wsp through the WSPBuilder there were no troubles but now every time I try to deploy, it keeps saying that it can't activate features because "The field with ID {insert random guid here} defined in feature {60938308-3563-497c-bc55-b2ae847ca8b8} (the feature activating my contenttype on the site) was found in a current site collection or in a subsite."
The contenttype and site columns gets created on the rootweb and even though I try to either deactivate the feature or completely uninstall it, the site columns and contenttype won't be deleted from the ContentType gallery or Site Columns gallery.
How can this be?
I use pure feature and XML functionality. No eventreceivers are involved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SharePoint 不允许您删除正在使用的网站栏和内容类型。这使得升级过程有点棘手。
如果您只想向内容类型添加字段,您可以使用 SharePoint 2010 中的功能升级工具。此博客文章系列应该对您有所帮助:http://www.sharepointnutsandbolts.com/2010/06/feature-upgrade-part-1-fundamentals.html
如果您需要进行任何其他更改(删除字段、更改类型等),那么您需要采取不同的方法。您将创建一个新的内容类型,该内容类型继承并最终替换现有的内容类型。此处讨论了此策略:http://msdn.microsoft.com/en-us /library/aa543504.aspx
SharePoint will not let you delete site columns and content types that are in use. This makes the upgrade process a little tricky.
If you just want to add a field to your content type you can use the Feature upgrade facilities in SharePoint 2010. This blog post series should help you: http://www.sharepointnutsandbolts.com/2010/06/feature-upgrade-part-1-fundamentals.html
If you need to make any other changes (remove field, change type, etc) then you need to take a different approach. You'll create a new content type that inherits from, and eventually replaces, your existing content type. This strategy is discussed here: http://msdn.microsoft.com/en-us/library/aa543504.aspx
除了检查 Rob 的建议之外:
您安装了 Visual Studio SP1 吗?
我在安装 SP1 之前收到该错误,解决方法是关闭所有 Visual Studio 实例并重新启动。启动后可以再次部署。
Besides checking out what Rob suggests:
Did you install Visual Studio SP1?
I received that error before installing SP1 and the workaround was closing all Visual Studio instances and starting it up again. After starting up deployment was possible again.