在一台Sharepoint2010 的Front End 上运行如下的代码,发现SPFarm.Local是空。

SPFarm.Local 为空的解决方法

用SPSecurity.RunWithElevatedPrivileges将代码包起来也不行。

 

用别的账号运行了一下,可以,看到是权限的问题。需要给运行的用户加如下的权限:

SPFarm.Local 为空的解决方法

同时需要注意的是 Target platform一定要是 x64.

SPFarm.Local 为空的解决方法

相关文章:

  • 2022-03-09
  • 2021-07-03
  • 2022-12-23
  • 2018-10-05
  • 2021-05-20
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2021-05-18
  • 2022-01-09
  • 2021-05-19
  • 2021-07-05
  • 2022-02-12
  • 2021-04-13
  • 2021-07-01
相关资源
相似解决方案