-
August 7th, 2010, 01:27 AM
#1
VS2008 Start w/o Debugging command question
I'm testing a project that needs to be run as administrator, is there any way to do this from VS 2008 IDE?
-
August 7th, 2010, 03:24 AM
#2
Re: VS2008 Start w/o Debugging command question
I have never seen any option for that but if it exists you would need to provide a valid admin login. So if you have access to an admin account why not just login as admin (or start another IDE using run as)?
-
August 7th, 2010, 05:03 AM
#3
Re: VS2008 Start w/o Debugging command question
The way it's set up, I'm using the IDE under a Standard User account so if I run the IDE as an administrator I will lose all the settings inside the Visual Studio. I agree that this is one way to do it, but the whole idea of setting up VS from scratch defeats the purpose.
So, I guess I'll stick with what I'm doing now. Which is adding a manual breakpoint to the code using DebugBreak(). I then run the compiled code from Windows Explorer using Run as Administrator command, after which I attach the VS debugger thru the JIT debugger option. As you see this is far from being simple and handy.
PS. Of course, if breaking the code isn't required right at the start, I attach to my process with the VS debugger later.
-
August 7th, 2010, 06:48 AM
#4
Re: VS2008 Start w/o Debugging command question
I played around a bit and actually came up with something that at least save you some manual steps. If you change Debugging settings to:
Command: runas
Command Arguments: /user:XXXX $(TargetPath)
your app will be executed with other credentials.
If you need to break at a specific location just insertand when it's reached you will be asked if you want to attach to the process.
-
August 7th, 2010, 02:17 PM
#5
Re: VS2008 Start w/o Debugging command question
Thanks. The DebugBreak() actually does just that. I mean int 3 part. I tried your approach with command line, but it doesn't really help because I will also need my own command line in this project. So I guess my only viable approach is to play with manifests and request elevation there (and then edit it out when I don't need it).
I've switched to VS 2008 just recently, so I'm curious, is adding of a manifest automated in it? Or do I still have to add it manually?
-
August 7th, 2010, 02:44 PM
#6
Re: VS2008 Start w/o Debugging command question
Without having tried I guess you can add the requested command line arguments after $(TargetPath)
-
August 7th, 2010, 03:05 PM
#7
Re: VS2008 Start w/o Debugging command question
Thanks, I'll try. So what about the manifest?
-
August 7th, 2010, 03:19 PM
#8
Re: VS2008 Start w/o Debugging command question
OK, I tried the manifest elevation and it still wants to restart the IDE under administrative account when I chose Debug command. It seems that there's no easy way around it.... Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|