我在 SharePoint 服务器 (2010) 上运行自定义 Web 服务。我的脚本运行正常,直到我调用更新数据库。我收到此错误:
Exception calling "Update" with "0" argument(s): "Access denied." ---> Access denied.
我的 Web 服务是用 C# 编写的,我不确定是否需要在代码中添加一些凭据,或者是否需要在服务器上进行一些安全更改。
捕获到异常:
System.Management.Automation.MethodInvocationException: Exception calling "Update" with "0" argument(s): "Access denied." ---> System.Security.SecurityException: Access denied. at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate() at Microsoft.SharePoint.Administration.SPDatabase.Update() at Update(Object , Object[] ) at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments) The Zone of the assembly that failed was: MyComputer --- End of inner exception stack trace --- at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments) at System.Management.Automation.DotNetAdapter.MethodInvokeDotNet(String methodName, Object target, MethodInformation[] methodInformation, Object[] arguments) at System.Management.Automation.Adapter.BaseMethodInvoke(PSMethod method, Object[] arguments) at System.Management.Automation.ParserOps.CallMethod(Token token, Object target, String methodName, Object[] paramArray, Boolean callStatic, Object valueToSet) at System.Management.Automation.MethodCallNode.InvokeMethod(Object target, Object[] arguments, Object value) at System.Management.Automation.MethodCallNode.Execute(Array input, Pipe outputPipe, ExecutionContext context) at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context) at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context) Exception caught.