Visual Studio - How to find which line in existing code requires elevated privileges
-
In the migration from windows 8 to windows 10 on a new computer I now have some previous programs that will not run in debug mode.
The message given is: "This task requires the application to have elevated permissions." I understand the message, but I am wanting to have an application that does not require elevated permissions, so how do I find which line of code require it. Is there a tool I can use to find which lines of code or declarations create the elevated permission requirements. I am using Visual studio 2017 (VB). I can find plenty of web pages telling me how to run the code as administrator, but would appreciate help on how to locate the offending code.
Madbiker
-
In the migration from windows 8 to windows 10 on a new computer I now have some previous programs that will not run in debug mode.
The message given is: "This task requires the application to have elevated permissions." I understand the message, but I am wanting to have an application that does not require elevated permissions, so how do I find which line of code require it. Is there a tool I can use to find which lines of code or declarations create the elevated permission requirements. I am using Visual studio 2017 (VB). I can find plenty of web pages telling me how to run the code as administrator, but would appreciate help on how to locate the offending code.
Madbiker
What sort of application is it, web, wpf, service, console? I wonder if a tool like resharper can do something like this. Other than that try/catch to identify the method I would think.
Never underestimate the power of human stupidity RAH
-
In the migration from windows 8 to windows 10 on a new computer I now have some previous programs that will not run in debug mode.
The message given is: "This task requires the application to have elevated permissions." I understand the message, but I am wanting to have an application that does not require elevated permissions, so how do I find which line of code require it. Is there a tool I can use to find which lines of code or declarations create the elevated permission requirements. I am using Visual studio 2017 (VB). I can find plenty of web pages telling me how to run the code as administrator, but would appreciate help on how to locate the offending code.
Madbiker
-
What sort of application is it, web, wpf, service, console? I wonder if a tool like resharper can do something like this. Other than that try/catch to identify the method I would think.
Never underestimate the power of human stupidity RAH
It is a desktop app publishes as a oneclick application, but on my new computer I cannot even start debugging because the error message appears after build and before run. If I try and deploy the previous published version I get a similar error message requiring elevated privileges, but the log file is a bit more useful from previous publish of code and states that the item system.runtime.interopservices.COMexception requires elevation. Unfortunately that code is used in one area as part of the try..catch routine to give a user friendly warning message so reluctant to remove and there may be more issues on other lines of code. Obviously there is something different about deploy a published app in Windows 10 compared to windows 8 where it did run (after asking for user permission), but I do not know where to look or how to debug - any ideas. Madbiker