Tuffwer
Tuffwer

Reputation: 1047

Is there a way to determine which functions in a Visual Studio C# solution require Administrator Privileges

I have recently been tasked with figuring out a way to remove the elevated privileges requirement for a c# application.

I'm not super familiar with C# but I do have access to the source code (multiple projects in one solution) and I'm using VS 2013 Professional.

So far I've been going through the code by hand and referencing documentation online to try to determine where the elevated privilege requirements are coming from.

Is there a way to use Visual Studio (or another piece of software) to determine which function calls are forcing the administrator privileges requirement?

Upvotes: 3

Views: 80

Answers (1)

Chris Travers
Chris Travers

Reputation: 26464

Not automatically, but there may be some ways to narrow things down quickly.

First if you have good test suites you could run these as a user without admin access and see which ones if any fail or prompt for UAC. This should allow you to narrow down sections of code quickly (I am a big fan of repurposing test suites btw). Also those that fail can be quickly corrected.

Another option would be manual testing, again by a user without admin access. Then the code can be reviewed where there are problems and the issues removed,

Without an automatic way of finding the problems, you should be prepared for some post-sign-off bug fixes however (so maybe having an experimental phase) may be good.

Upvotes: 1

Related Questions