문제

I have a ASP.NET web application on Windows 7.

The application runs as an administrator on the server and intermittently I get the unexpected error:

System.ComponentModel.Win32Exception (0x80004005): Access is denied
    at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
    at System.Diagnostics.Process.GetProcessTimes()
    at System.Diagnostics.Process.get_StartTime() 

When I call:

_process = Process.GetCurrentProcess();
_startupTime = _process.StartTime;
도움이 되었습니까?

해결책

It looks like the issue is caused because of the way we do security. This function should only get called on start up which should happen as an Admin but if the Application Pool restarts itself after a period of inactivity (set to 20 minutes) by changing it to 24 hours the problem went away as we never have a period of 24 hours of inactivity.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top