1

在 sharePoint 2010 Server 中创建 WebPart 时出现以下错误。

Web 部件错误:部分信任应用程序域中的用户代码包装器的 Execute 方法引发了未处理的异常:System.Web.HttpUnhandledException:引发了“System.Web.HttpUnhandledException”类型的异常。---> System.TypeLoadException:无法从程序集“Microsoft.SharePoint,Version=14.900.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c”加载类型“Microsoft.SharePoint.WebControls.SPGridView”。在 ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() 在 System.Web.UI.Control.EnsureChildControls() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web .UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Control.PreRenderRecursiveInternal() 在 System.Web.UI.Page。

4

1 回答 1

0

当您查看 SharePoint 2010 服务器时,GAC (windows\assembly) 中的 Microsoft.Sharepoint DLL 的版本号是多少?如果您的代码以某种方式特别绑定到版本 14.900.00 并且程序集中的版本不同,那么这可能是您的问题。

另外,只是想仔细检查一下您没有在解决方案中部署 Microsoft.SharePoint DLL 的副本,因为那样会很糟糕。

于 2011-07-20T16:45:14.287 回答