Access is denied

Mar 13, 2012 at 3:26 PM

I am getting the following error while using Visual studio 2010 on windows 7, other applications are running fine but SuperWebsocket is giving error.

i had also defined impersonate in web.config.

System.ComponentModel.Win32Exception was unhandled
  Message=Access is denied
       at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
       at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
       at System.Diagnostics.Process.GetProcessTimes()
       at System.Diagnostics.Process.get_StartTime()
       at SuperSocket.SocketEngine.SocketServerManager.OnCpuUsageTimerCallback(Object state)
       at System.Threading._TimerCallback.TimerCallback_Context(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._TimerCallback.PerformTimerCallback(Object state)

Mar 13, 2012 at 3:32 PM

Oh, you needn't set Impersonate, please tell me which account are your website's application pool is running as? Could you change it to Network Service or Local Service?

Mar 13, 2012 at 3:38 PM

yes it is running under network  service.

Mar 13, 2012 at 3:40 PM

But you told me you used VS2010 to run it?

Did you deploy the website in IIS?

Mar 14, 2012 at 8:47 AM

Yes using VS2010 , and my Default application Pool is Running under network service Account. i am using IIS 7.5 .

Application is Running Fine when Deployed in IIS but when i run through visual studio it is giving me this error. Rest of applications are running Fine.

Mar 14, 2012 at 8:51 AM

I am not sure how to control the running account of VS2010's development server, so I suggest you use IIS to test!

Because SuperWebSocket need to access System.Diagnostics.Process, so higher permission is requried for it.