代码之家  ›  专栏  ›  技术社区  ›  Basant B. Pandey

如何解决错误:“无法加载类型”Microsoft.SharePoint.WebControls.SPGridView“SharePoint 2010”?

  •  1
  • Basant B. Pandey  · 技术社区  · 15 年前

    在SharePoint 2010服务器中创建Web部件时出现以下错误。

    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”。在System.Web.UI.Control.EnsureChildControls()的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()上。.page.processRequestMain(boolean includeStagesBeforeAsyncPoint,boolean includeStagesAfterAsyncPoint)---内部异常堆栈跟踪结束---at System.web.ui.page.handleError(exception e e)at System.web.ui.page.processRequestMain(boolean includeStagesBeforeAsyncPoint,boolean includeStagesAfterAsyncPoint)at System.web.ui.page.processRequest(bo在system.web.ui.page.processrequest()的system.web.ui.page.processrequest()上,在microsoft.sharepoint.usercode.spusercodewebpartwrapper.executehttprequest(spusercodewebparthttprequestcontext webpartexecutioncontext,spusercodewebparthttpresponse httprequest)上,在system.web.ui.page.processrequest()上,在system.web.ui.page.processrequest(httpcontext contextstresponse)位于Microsoft.SharePoint.Usercode.spUsercodeWebPartWrapper.Execute(spUsercodeExecutionContext ExecutionContext)位于Microsoft.SharePoint.Usercode.spUsercodeApplicationHostapDomainRef.Execute(类型为UsercodeWrapperType,spUsercodeAchedassemblyGroup UserAssemblyGroup,guid siteCollectionID,byte[]binaryUsercodeToken,byte[]proxyOperation令牌,spUserCodeExecutionContext ExecutionContext)

    1 回复  |  直到 14 年前
        1
  •  0
  •   Bo Persson Touseef    14 年前

    查看SharePoint 2010服务器时,GAC(Windows\程序集)中的Microsoft.SharePoint dll的版本号是多少?如果您的代码与版本14.900.00特别相关,并且程序集中的版本不同,那么这可能是您的问题。

    另外,只想再次检查您是否没有在解决方案中部署Microsoft.SharePoint dll的副本,因为这样做会很糟糕。