【发布时间】:2011-07-08 00:01:40
【问题描述】:
可以通过创建文件向 web.config 添加密钥:12/CONFIG/webconfig.name.xml (见http://msdn.microsoft.com/en-us/library/ee413929.aspx) 附内容:
<actions>
<add path="configuration/SharePoint/SafeControls">
<SafeControl
Assembly="CustomWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=123456789abcdefgABC"
Namespace="CustomWebPart"
TypeName="*"
Safe="True" />
</add>
<add path="configuration/runtime/assemblyBinding">
<dependentAssembly>
<assemblyIdentity name="CustomWebPart" publicKeyToken="123456789abcdefgABC" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</actions>
这对于添加安全控件非常有用,但它似乎不适用于程序集重定向。有谁知道为什么这不起作用?是不是只能添加“configuration/SharePoint/”内的标签?
【问题讨论】:
标签: sharepoint sharepoint-2007 web-config declarative