View Single Post
  #1 (permalink)  
Old November 18th, 2011, 03:01 AM
codehelp codehelp is offline
Authorized User
Points: 135, Level: 2
Points: 135, Level: 2 Points: 135, Level: 2 Points: 135, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2007
Location: , , .
Posts: 29
Thanks: 2
Thanked 0 Times in 0 Posts
Default How to Debug a Console Application which starts with an Argument.

Hello everyone,
I have a Console Application which is started with an argument (it accepts an XML file and processes it).

I check the args.Lenght to find out if an argument was supplied or not and display messages appropriately.

This application is part of a workflow in which another application calls this Console App with the XML file as argument.
When this happens VS does not step into the code for debugging. The exe behaves as standalone. The same thing happens when the exe is called from the command line.

I know that a Argument can be set in the Project Properties, but then VS will alway load the same XML file, which beats the purpose of Debugging.

Is there a way for VS to start in debug mode when this Console App exe is called either by an external App or when executed through the DOS Command Line.

Regards