Sharepoint ContentTypeBinding 和 Lookup 字段存在问题
创建新网站时,我遇到 ContentTypeBinding 问题。我有自定义站点模板定义,其中引用了发布服务器功能,因此列表页面会在站点上自动创建。我需要将自定义内容类型绑定到 OOB 页面列表。有人知道该怎么做吗?我的自定义内容类型是按网站集范围上的功能部署的。
现在我试图用这种方式来做,但它不起作用。在网站模板中,我引用功能,其中包含具有内容类型绑定的元素:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentTypeBinding ContentTypeId="GUIDOFCONTENTTYPE" ListUrl="Pages" />
</Elements>
当我尝试创建新网站时收到此错误:
SPContentTypeBindingElement.ElementActivated()。绑定内容类型“0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390045BF70D1ABCA4A5BBF576B785EB3A37D”以列出“/site/Pages”时出错网址“http://xxx/site”。异常'0x80070057owssvr.dll:(无法解析的符号,模块偏移=0000000000034256) 在0x000007FEE9954256 mscorwks.dll:(未解析的符号,模块偏移=00000000002BF6D7) 位于 0x000007FEF61FF6D7 Microsoft.SharePoint.Library.ni.dll:(无法解析的符号,模块偏移量=00000000000DAB02) 位于 0x000007FEEAD9AB02 Microsoft.SharePoint.ni.dll:(无法解析的符号,模块偏移量=0000000001A7B029) 位于 0x000007FEEE8BB029 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=0000000001BDCBB1) 位于 0x000007FEEEA1CBB1 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=0000000001AB76AB) 位于 0x000007FEEE8F76AB Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=0000000001AB7D2A) 在 0x000007FEEE8F7D2A Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001AB6E1F) 在 0x000007FEEE8F6E1F Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001BFCB4F) 在 0x000007FEEEA3CB4F Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001BFDF52) 位于 0x000007FEEEA3DF52 Microsoft.SharePoint.ni.dll:(无法解析的符号,模块偏移量=00000000025D073E) 在 0x000007FEEF41073E Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=00000000025D0DEC) 位于 0x000007FEEF410DEC Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=0000000001F0BD0F) 在 0x000007FEEED4BD0F Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001F0D8A6) 在 0x000007FEEED4D8A6 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001D2B8EE) 在 0x000007FEEEB6B8EE Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001AD36D4) 在 0x000007FEEE9136D4 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=0000000001AD2F86) 位于 0x000007FEEE912F86 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=00000000020D4DCD) 在 0x000007FEEEF14DCD Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移=00000000022B8A80) 位于 0x000007FEEF0F8A80 Microsoft.SharePoint.ni.dll:(未解析的符号,模块偏移量=0000000001B006B6) 位于 0x000007FEEE9406B6 Microsoft.S'。
有人有这方面的经验吗?
更新:
我找到了导致问题的原因。它是我的内容类型中的查找字段。当我把这个查找出来时,它工作正常。但我还是不知道如何解决。
我的查找的定义:
<Field ID="{2FF1B484-6D70-449c-8E5C-904E4D5971E1}"
Name="PageCategory"
Group="Intranet Columns"
Type="Lookup"
DisplayName="PageCategory"
List="Lists/Categories"
ShowField="Title"
PrependId="TRUE"/>
我知道,在创建此字段之前,列表类别必须存在。因此,我的类别列表是在 Web 范围功能 A 中创建的,而此查找字段、内容类型 + 查找字段和内容类型绑定位于另一个功能 B 中。我添加了从 B 到 A 的依赖项。这两个功能都在 onet.xml 中引用。不幸的是我仍然有一些问题。
I have a problem with ContentTypeBinding when creating a new site. I have custom site template definition where I have referenced Publishing Server Feature, so list Pages is automatically created on site. I need to bind custom content type to OOB Pages list. Do anybody know how to do that? My custom content type is deployed by feature on site collection scope.
Now I trying to do it in this way, but it's not working. In site template I referencing feature, which contains element with content type binding:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentTypeBinding ContentTypeId="GUIDOFCONTENTTYPE" ListUrl="Pages" />
</Elements>
I'm getting this error when I try to create new site:
SPContentTypeBindingElement.ElementActivated(). An error occurred binding content type '0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390045BF70D1ABCA4A5BBF576B785EB3A37D' to list '/site/Pages' on web 'http://xxx/site'. Exception '0x80070057owssvr.dll: (unresolved symbol, module offset=0000000000034256)
at 0x000007FEE9954256 mscorwks.dll: (unresolved symbol, module offset=00000000002BF6D7)
at 0x000007FEF61FF6D7 Microsoft.SharePoint.Library.ni.dll: (unresolved symbol, module offset=00000000000DAB02)
at 0x000007FEEAD9AB02 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001A7B029)
at 0x000007FEEE8BB029 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001BDCBB1)
at 0x000007FEEEA1CBB1 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB76AB)
at 0x000007FEEE8F76AB Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB7D2A)
at 0x000007FEEE8F7D2A Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AB6E1F)
at 0x000007FEEE8F6E1F Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001BFCB4F)
at 0x000007FEEEA3CB4F Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001BFDF52)
at 0x000007FEEEA3DF52 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=00000000025D073E)
at 0x000007FEEF41073E Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=00000000025D0DEC)
at 0x000007FEEF410DEC Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F0BD0F)
at 0x000007FEEED4BD0F Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001F0D8A6)
at 0x000007FEEED4D8A6 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001D2B8EE)
at 0x000007FEEEB6B8EE Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AD36D4)
at 0x000007FEEE9136D4 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001AD2F86)
at 0x000007FEEE912F86 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=00000000020D4DCD)
at 0x000007FEEEF14DCD Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=00000000022B8A80)
at 0x000007FEEF0F8A80 Microsoft.SharePoint.ni.dll: (unresolved symbol, module offset=0000000001B006B6)
at 0x000007FEEE9406B6 Microsoft.S'.
Have anybody some experience with that?
UPDATE:
I finded what causes my problem. It's lookup field in my content type. When I put this lookup out it works OK. But I still don't know how to resolve it.
Definition of my lookup:
<Field ID="{2FF1B484-6D70-449c-8E5C-904E4D5971E1}"
Name="PageCategory"
Group="Intranet Columns"
Type="Lookup"
DisplayName="PageCategory"
List="Lists/Categories"
ShowField="Title"
PrependId="TRUE"/>
I know, that before this field is created list Categories must exists. So my Categories list is created in web-scope feature A and this lookup field, content type + lookup field and content type binding is in another feature B. I added dependency from B to A. Both features are referenced in onet.xml. Unfortunately I've got still the some problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了这个问题。如果其他人对解决方案感兴趣,可以在这里:
Sharepoint ContentTypeBinding 和 Lookup 字段出现问题
I resolved this issue already. If somebody else is interested in the solution, it is here:
Problem with Sharepoint ContentTypeBinding and Lookup field