Q:

C#: Run application in debug mode

I have an WinForms application. I wan't to run app sometimes with parameter, like this:
myapp.exe -d

which tells app to do some unusual actions like write a log, or show some additional info.
What is the best way to do it?
The first came to my mind was an adding main function args reading, and when parameter passed then create some flag and then use it to do some additional actions.
But maybe there is more beautiful and right way for this?

A:

If this is a feature that is going to be rarely used, consider using:
Trace.WriteLine("");

Then use something like DebugView whenever you need to...
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

