SharePoint 2010 Web 部件部署错误
当我在本地部署 Web 部件时,一切都很好。 Web 部件已注册为安全且完全可用。
当我将 wsp 部署到另一台服务器时,尽管所有内容似乎都已正确部署(并且 SafeControls 出现在 web.config 中),但 Web 部件会返回以下错误。 :
Web 部件错误:无法显示或导入此页面上的 Web 部件或 Web 窗体控件。找不到类型 XXXXX 或未将其注册为安全类型。
这与这个问题几乎完全相同。唯一的区别是,当我查看正在部署的服务器上的 web.config 时,我确实看到了 SafeControls。
对我可以尝试解决问题的事情有什么想法吗?服务器设置,我如何打包或部署等。
When I deploy my web part locally everything is fine. The web part is registered as safe, and is completely usable.
When I deploy the wsp to another server the web part comes back with the following error although everything appears to be deployed correctly (and the SafeControls appear within the web.config). :
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type XXXXX could not be found or it is not registered as safe.
It is almost the exact same issue as this question. The only difference being that when I look at my web.config on the server I am deploying to I DO see the SafeControls.
Any thoughts on things that I could try to fix the issue? Server settings, how I package or deploy, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过手动从 GAC 中删除解决方案来解决我的问题。然后我尝试再次添加解决方案,一切正常。
我在初次上传解决方案后添加了有问题的 Web 部件(很抱歉将该部分排除在描述之外)。在执行此操作之前,我尝试从中央管理中撤回并删除,然后重试添加。显然这实际上并没有从 GAC 中删除该解决方案。
该网站使用的是旧版本的解决方案,该解决方案确实不包含新 Web 部件的 SafeControl。一旦旧版本被删除,新版本的添加就顺利进行了,一切都很好。
感谢大家的建议。
I was able to solve my issues by manually removing the solution from the GAC. Then I just tried to add the solution again and everything works well.
I had added the web part in question after the initial upload of the solution (sorry about leaving that part out of the description). Before doing this I was trying to retract and delete from the Central Admin then retry the addition. Apparently this didn't actually delete the solution from the GAC.
The site was using the old version of the solution which did indeed not include a SafeControl for the new web part. Once the old version was removed the addition of the new version went without a hitch and all is well.
Thanks to all for their suggestions.