ERROR: System.Web.Services.Protocols.SoapException: Server was unable to process request.

今天遇到一个问题:

 

Note:  The following information was gathered when the operation was attempted.  The information may appear cryptic but provides context for the error.  The application will continue to run.

System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the temp directory is denied.  Identity 'NT AUTHORITY\NETWORK SERVICE' under which XmlSerializer is running does not have sufficient permission to access the temp directory.  CodeDom will use the user account the process is using to do the compilation, so if the user doesnt have access to system temp directory, you will not be able to compile.  Use Path.GetTempPath() API to find out the temp directory location.
   at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence)
   at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
   --- End of inner exception stack trace ---
   at Microsoft.UpdateServices.Administration.AdminProxy.CreateUpdateServer(Object[] args)
   at Microsoft.UpdateServices.Administration.AdminProxy.GetUpdateServer()
   at Microsoft.EnterpriseManagement.SCE.Internal.UI.Console.UpdateServerService.Connect(String serverName, Boolean connectSecurely, Int32 socketNumber)
   at Microsoft.EnterpriseManagement.SCE.Internal.UI.Console.UpdateServerService.Connect(String serverName)
   at Microsoft.EnterpriseManagement.SCE.Internal.UI.Console.EssentialsConsoleWindow.ConnectToManagementGroupJob(Object sender, ConsoleJobEventArgs args)
   at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleJobExceptionHandler.ExecuteJob(IComponent jobOwner, EventHandler`1 job, Object sender, ConsoleJobEventArgs args)

 

 

本来,我的WebService用的好好的,因为系统老是提示磁盘不足(我用的的VPC环境),于是乎就找了一个删除临时文件的bat文件执行了一下,结果得到了进1G的空间。可是,这个时候我的WebService出错了,错误信息如上。

 

解决方案如下:

设置目录 C:\Windows\Temp 的对用访问权限为 “FULL CONTROL”。

 

参考资料:

http://social.technet.microsoft.com/forums/en-US/systemcenter/thread/55cafe5f-b7a6-4d38-8cfe-c2718c05de0b

转载于:https://www.cnblogs.com/romanticoding/archive/2010/07/14/1777262.html

你可能感兴趣的:(移动开发,c#)