views:

1464

answers:

2

When I start my process from Visual Studio, it is always created inside a job object. I would like to know how to turn this behaviour off. Any ideas?

I expect that it is created in a job object to be debugged. I want to place my program in a different job object.

It's not the hosting process. I'm talking about a Job Object. This is an unmanaged C++ application.

+1  A: 

I'm not aware of any ways to control this aspect of processes spawned for debugging by VS.NET. But there's a workaround, which is applicable to any situation in which VS.NET can't or doesn't start your process in the exact way you want:

Start your process (possibly using a wrapper EXE that runs as part of the post-build event), then attach to the newly started process using Tools/Attach to Process. If you break into the debugger as part of your startup code, this won't even be required (and you can also debug startup issues...).

mdb
In the debugging options for the project there is a "Attach to process" option which will make debugging a little more seamless. [Either way, this doesn't work very well if the process [say a command-line utlity] is non-interactive and finishes before you can attach to it... #ifdef DEBUG FTW!]
sphereinabox
It doesn't really matter, actually the problem occurs whether the process is started in the debugger or not, so long as it is started from visual studio. Thanks for the suggestion though.
1800 INFORMATION
+1  A: 

I can't reproduce what you're seeing. I've created an unmanaged C++ application in both VS 2005 and VS 2008 and I have no problems associating that process to a new job object when starting the process in VS.

Are you sure the debugger is doing this?

Peter Ritchie
No doubt about it. I can see in Process Explorer that it is started inside a job that contains devenv. If I start it from the command line then it is inside no job when it starts.
1800 INFORMATION