c# - How to debug System.InvalidOperationException in System.Security.AccessControl.Privilege.Revert() -


i have application started crashing when shutting down following error in event log:

application: app.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.invalidoperationexception stack:    @ system.security.accesscontrol.privilege.revert()    @ system.security.accesscontrol.privilege.finalize() 

i did digging in .net reference source method , appears exception thrown @ bottom. can't first invalidoperationexception because not contain message, 1 @ end of method throws blank 1 has match.

the call adjusttokenprivileges (p/invoke) failing , checks not find expected error code:

if ( error == win32native.error_not_enough_memory ) {     throw new outofmemoryexception(); } else if ( error == win32native.error_access_denied ) {     throw new unauthorizedaccessexception(); } else if ( error != 0 ) {     contract.assert( false, string.format( cultureinfo.invariantculture, "adjusttokenprivileges() failed unrecognized error code {0}", error ));     throw new invalidoperationexception(); } 

the documentation on function doesn't highlight obvious regard may going wrong either.

the recent changes application included adding basic self-hosted wcf end-point in application (named pipes) i'm struggling understand why occur because of that. it's not disposable either i'm not in control of when gets called.

could tell me find error code since not included in exception thrown? appreciate explanation/speculation why destructor of class getting called when don't instantiate access control classes myself. wcf doing access tokens? uac disabled , local administrator on machine running application.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -