我使用VS2010创建了一个"Hello World“SharePoint2010解决方案。它只包含一个特性和一个包含标签的and部件。在VS2010中,我在the部件的“属性”窗口中将the部件注册为安全控件。
当我将我的解决方案部署到我的本地服务器上时,一切都运行得很好!我可以将the部件添加到页面,并且在web.config文件中,我的控件被添加到SafeControls列表中。当我在不同的服务器上安装相同的解决方案时,我可以在可用see部件列表中看到该see部件,但当我尝试将其添加到页面时,它告诉我它未注册为安全。当我检查web.config文件时,我的控件没有条目。如果我手动添加一个(从我的开发服务器),事情就开始工作了。
现在,我想知道为什么当我安装wsp文件时控件没有注册。wsp内的清单包含以下行:
<Assemblies>
<Assembly Location="abc.TestWebPart.dll" DeploymentTarget="GlobalAssemblyCache">
<SafeControls>
<SafeControl Assembly="abc.TestWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e262c75e6f6e8440" Namespace="abc.TestWebPart.VisualWebPart1" TypeName="*" />
</SafeControls>
</Assembly>任何想法都非常受欢迎!
发布于 2010-10-15 00:18:03
检查输入错误和版本差异。
发布于 2012-08-20 09:43:05
您是否激活了web应用程序的功能?
发布于 2013-04-19 17:43:04
我知道你回答晚了。
我认为您的SafeControl标签中缺少‘Safe="TRUE“’。
正确的代码:
<Assemblies>
<Assembly Location="abc.TestWebPart.dll" DeploymentTarget="GlobalAssemblyCache">
<SafeControls>
<SafeControl
Assembly="abc.TestWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e262c75e6f6e8440"
Namespace="abc.TestWebPart.VisualWebPart1"
TypeName="*"
Safe="TRUE"
/>
</SafeControls>
</Assembly>
</Assemblies>https://stackoverflow.com/questions/3891038
复制相似问题