设为首页 收藏本站
查看: 1054|回复: 0

[经验分享] SharePoint问题清单

[复制链接]

尚未签到

发表于 2015-9-25 07:44:39 | 显示全部楼层 |阅读模式
  目录
  1 显示SharePoint错误... 1
  2 The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again. 2
  3 Operation is not valid due to the current state of the object. 2
  4 Illegal characters in path. 【路径中非法字符。】... 4
  5 加载控件模板文件 /_controltemplates/TaxonomyPicker.ascx 失败... 4
  6 SharePoint导航栏错误... 4
  7 解决SharePoint 2010拒绝访问爬网内容源错误的小技巧... 5
  8 部署步骤“回收 IIS 应用程序池”中出现错误: 本地 SharePoint 服务器不可用。请检查该服务器是否正在运行并连接到 SharePoint 服务器场... 6
  9 缺少服务器端相关性... 6
  10 SharePoint 2010 在WebPart页面上调用扩展方法报方法未定义的解决方案... 错误!未定义书签。
1 显示SharePoint错误
  SharePoint经常会报未知错误,不利于错误的排查,那么你可以做以下操作来处理。
  在该站点下的配置文件里面修改以下节点
  1.<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
  改为:
  <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
  2.<customErrors mode="On " /> 改为:<customErrors mode="Off " />
  3.<compilation batch="false" debug="false ">改为; <compilation batch="false" debug="true ">
  修改后就会把错误源显示出来,总比报"未知错误"好吧!
2 The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.
  Microsoft.SharePoint.Administration.SPWebApplication webApp = site.Site.WebApplication;
  webApp.FormDigestSettings.Enabled = false;
  SPFile spFile = site.Files.Add(fileUpload.FileName, contents);
  spFile.Item.Update();
  webApp.FormDigestSettings.Enabled = true;
  web.AllowUnsafeUpdates = true;
  site.AllowUnsafeUpdates = true;
3 Operation is not valid due to the current state of the object
  提升权限
  SPSecurity.RunWithElevatedPrivileges(delegate() {
  SPSite site = new SPSite(http://jianghao:9000 );
  SPWeb web = site.OpenWeb();
  using (site)
  //...
  });
  或者:
  private string GetPictureUrl(string loginName)
  {
  SPSite site = null;
  SPWeb web = null;
  using (site = new SPSite(mySiteUrl))
  {
  using (web = site.RootWeb)
  {
  web.AllowUnsafeUpdates = true;
  ServerContext ctx = ServerContext.GetContext(site);
  UserProfileManager profileMgr = new UserProfileManager(ctx);
  if (HttpContext.Current != null)
  {
  if (HttpContext.Current.Items["HttpHandlerSPWeb"] == null)
  {
  HttpContext.Current.Items["HttpHandlerSPWeb"] = web;
  }
  if (HttpContext.Current.Items["Microsoft.Office.ServerContext"] == null)
  {
  HttpContext.Current.Items["Microsoft.Office.ServerContext"] = ctx;
  }
  }
  if (profileMgr.UserExists(loginName))
  {
  //Microsoft.SharePoint.Portal.UserProfiles.UserProfile up =  upMan.GetUserProfile(loginName);
  Microsoft.Office.Server.UserProfiles.UserProfile up = profileMgr.GetUserProfile(loginName);
  if (!string.IsNullOrEmpty(up[PropertyConstants.PictureUrl].Value as string))
  {
  return up[PropertyConstants.PictureUrl].Value.ToString();
  }
  else { return “”; } }
  注意,不能乱提升权限,因为提升权限后一切都是System Account用户的操作!比如是别人回复的博客和 Discussions 的回复人都是"System Account"这个人!这个当然是不对的了!
4 Illegal characters in path. 【路径中非法字符。】
  检查用户控件src属性值是否换行了。
5 加载控件模板文件 /_controltemplates/TaxonomyPicker.ascx 失败
  加载控件模板文件 /_controltemplates/TaxonomyPicker.ascx 失败: 未能从程序集“Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”中加载类型“Microsoft.SharePoint.Portal.WebControls.TaxonomyPicker”。
  解决方法:
  用记事本打开  TaxonomyPicker.ascx 文件,定位到第一行 将 字符  "&#44;"  (不包含引号),替换为一个英文逗号 ","
6 SharePoint导航栏错误
  Microsoft.SharePoint.Publishing.Internal.CodeBehind.AreaNavigationSettingsPage.OKButton_Click(Object sender, EventArgs e)
  at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
  at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
  at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
  at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
  at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  来自 <http://go4answers.webhost4life.com/Example/unable-modify-navigation-headinglink-20585.aspx>
  解决方案一:关闭网站【发布】功能,然后再启用
  解决方案二:从内容数据库“NavNodes”表进行更改,比如:
  INSERT INTO
  [NavNodes] ([SiteId] ,[WebId] ,[Eid] ,[EidParent] ,[NumChildren] ,[RankChild] ,[ElementType] ,[Url] ,[DocId] ,[Name] ,[DateLastModified] ,[NodeMetainfo] , NonNavPage] ,[NavSequence] ,[ChildOfSequence])
  SELECT DISTINCT
  SiteId, WebId ,1002 ,0 ,0 ,1 ,1 ,'' ,NULL ,'SharePoint Top Navbar' ,getdate() ,NULL ,0 ,1 ,0
  FROM NavNodes
  WHERE WebId NOT IN (
  SELECT WebId
  FROM NavNodes
  WHERE Eid = 1002)
  解决方案三:回收应用程序池
  解决方案四:
  This is a very strange behavior. The global navigation seems corrupted. And if I try to modify the navigation through the sharepoint navigation UI, changes won't apply. I have fixed the problem by calling the API.
  My solution: A navigation modification feature.
  In the feature-receiver I have made the code to modify the navigation
  ...
  ' Remove website from global and current navigation
  PublishingWeb pw = PublishingWeb.GetPublishingWeb(mySite);
  pw.IncludeInCurrentNavigation = false;
  pw.IncludeInGlobalNavigation = false;
  This solution is not very nice though. Every time we need a change in the global navigation we have to modify the code and make a redeployment, which seems very troublesome... Any other suggestions on how to solve this problem
7 解决SharePoint 2010拒绝访问爬网内容源错误的小技巧
  这里有一条解决在SharePoint 2010搜索爬网时遇到的“拒绝访问错误”的小技巧。
  首先要检查默认内容访问帐户是否具有相应的访问权限,或者添加一条相应的爬网规则。如果目标资源库是一个SharePoint库,验证一下该帐号是否具有对该SharePoint web应用程序具有至少“完全读取”的权限。
  当我在升级上来的SharePoint环境中对我新建的博客URL进行爬网时遇到了这个错误。
  这个错误发生在当你运行Windows 2008 R2和SharePoint 2010并且爬网进程试图访问一个本地的sharepoint站点时,会因为“环回请求(LoopbackRequest)”的原因被拒绝。这是在IIS 7和7.5中的一项安全设置。
  解决办法是运行“regedit”,在注册表中“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa” 下添加一个DWORD值 “DisableLoopBackCheck”=1。
  参考资料
  Access Denied Crawling content source in SharePoint 2010
8 部署步骤“回收 IIS 应用程序池”中出现错误: 本地 SharePoint 服务器不可用。请检查该服务器是否正在运行并连接到 SharePoint 服务器场
  多用户使用同一测试机进行SharePoint开发时,发现只有Administrator用户可以正确的部署程序集到SharePoint,其他用户即使加到管理员组中也无法部署,VisualStudio2010部署时,提示错误:
  部署步骤“回收 IIS 应用程序池”中出现错误: 本地 SharePoint 服务器不可用。请检查该服务器是否正在运行并连接到 SharePoint 服务器场。
  原因是该用户虽然对SharePoint网站和SharePoint的前端服务器有控制权,但对SharePoint相关数据库没有权限所致,解决方法:
  打开 SahrePoint的SqlServer数据库,服务器----安全性----添加用户
  配置该用户映射:
  为以下数据库添加用户权限为db_owner
  SharePoint_Config
  SharePoint_AdminContent_[guid]
  SharePoint Site Content DB
  再次打开VS,建项目,编译部署,部署成功。
9 缺少服务器端相关性
  SharePoint 运行状况分析器已检测到一些值得关注的关键问题。
DSC0000.jpg
  直接通过数据库来查找。用来检查错误的timerjob实际上在对应的内容数据库上运行了一个这样的查询:
  SELECT tp_WebPartTypeId, COUNT(1), tp_Assembly, tp_Class
FROM AllWebParts (NOLOCK)   
WHERE tp_WebPartTypeId IS NOT NULL GROUP BY tp_WebPartTypeId, tp_Assembly, tp_Class
  通过错误信息提供给我们的WebPartTypeId,进行如下的查询:
  SELECT *   
FROM AllWebParts   
WHERE tp_WebPartTypeId = 'b82a8e9d-8706-3252-0a3b-ba19bf65e250'
  该查询可以获取WebSiteID,该表还有一些其他的信息,可供我们排错。常用的几个表以及关系如下:
  SELECT Webs.FullUrl, Webs.Title, AllDocs.DirName, AllDocs.LeafName
  FROM AllDocs, Sites, AllWebParts, Webs
  WHERE Webs.Id = Sites.RootWebId AND AllDocs.Id = AllWebParts.tp_PageUrlID
  AND Sites.Id = AllDocs.SiteId
  找出这些网页,逐个打开并排除这些错误。
10 SharePoint 2010 在WebPart页面或应用程序页上调用扩展方法报方法未定义的解决方案
  SharePoint 2010前台代码是使用.NET 2.0编译器编译的,故找不到扩展方法,解决该问题的方案是将其设置为3.5编译器,即在web.config添加以下配置:
  <system.codedom>  
  <compilers>  
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">  
      <providerOption name="CompilerVersion" value="v3.5" />  
      <providerOption name="WarnAsError" value="false" />  
    </compiler>  
  </compilers>  
</system.codedom>

  注意这个:“<providerOption name="CompilerVersion" value="v3.5" />”。
11 使用Visual Studio 部署SharePoint时提示“路径中具有非法字符”
  在使用VS 2012部署或发布SharePoint时,提示“路径中具有非法字符”(英文提示“Illegal characters in path”),找了半天,才找到答案。
  这个原因是路径中含有中文或者特殊字符导致的。比如使用Windows 8 live帐号登陆,会将中文名作为用户名,这时就会报这个错误。
  解决方案:
  第一,检查临时目录路径,进行修改。
  更改方式如下:用鼠标右键单击“我的电脑” - >属性 - >高级系统设置 - > 环境变量
DSC0001.gif
  第二,检查项目和解决方案路径:
  VisualStudio2010 - >工具- >选项- >项目和解决方案,确定这些位置不含非法字符(包括中文)。
DSC0002.gif

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-118351-1-1.html 上篇帖子: SharePoint Server 2013开发之旅(三):为SharePoint Server配置App开发、部署、管理环境 下篇帖子: [翻译文章]我们是如何做到的: 提高SharePoint.Microsoft.com站点的性能
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表