cool hit counter [Handy] Call to Process.EnterDebugMode raises an exception: not all referenced privileges or groups are assigned to the caller_Intefrankly

[Handy] Call to Process.EnterDebugMode raises an exception: not all referenced privileges or groups are assigned to the caller


Just went live with a new version and one of the computers opened the software and reported [xx's type initial value setting item raised an exception] (luckily it wasn't a big wave of computers, new stuff goes live for fear of woe), as shown in the image.

Apparently an exception was thrown in the static constructor of that type (the class name is in red), so the class was opened, and the only sentence in its constructor that looked like it might raise an exception was.

 Process.EnterDebugMode();  // used to enable debugging privileges for this process (SeDebugPrivilege)

With that, I put the sentence into a test program, then copied the test program to the computer in question and ran it, and sure enough it was, throwing the exception. Win32Exception:Not all referenced privileges or groups are assigned to the caller. As pictured.

But why the development machine and other computers are not throwing it, I can roughly guess with the machine permissions are not enough, first check whether the current user management group, is the management group, but not the built-in administrator administrator, immediately associated with UAC (User Account Control, this goods I once groan over, it would make the self-built admin behave differently than the built-in admin, so I was impressed), check it out and sure enough that's it. Problem solved after shutting down UAC and rebooting

Also I added try-catch to that code and just ate it, because debugging privileges are not required in this program and it doesn't matter if you can't get them.

-Bunbi-


Recommended>>
1、The worlds school girl level of beautiful robots
2、Nine blockchain projects on the ZB exchange with zero codebase Watch out for the air
3、System unbundling and structural evolution
4、A Rookies Primer on Blockchain What is a smart contract
5、Apple Appstore and GooglePlay Privacy Agreement Writing Guidelines for the Apple App Store

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号