Solved

c# Console windows in a WPF application

Posted on 2011-03-09
2
1,161 Views
Last Modified: 2013-12-17
I've searched the internet and found that it appears to be impossible to open a console window with a windows WPF application.  I'm hoping that someone knows a work around or knows another way to do this.

I've got an application that I want to debug.  In programming with linux or many other languages I would just put in a printf and dump variable information to let me know how far an application has made it.

In my app I use a background worker process and it works great in my lab and a couple of other places but at one location it just sits.  My ideal world would be to open a console window and dump information from the process to the window as it goes.  

Since I'm using a background worker, it's not easy to even put in a label and update the label with what is going on.  And since I don't have visual studio on this production server I can't compile and run it there and access breakpoints.

Anyone have an idea on how I can debug in this environment?

Thanks.
0
Comment
Question by:sej69
2 Comments
 
LVL 14

Accepted Solution

by:
athomsfere earned 500 total points
ID: 35085038
How about use WriteLine a StreamWriter to write the output to a txt file? After the hang or crash just open the text file and look?

Seems to be the easiest, straightforward thing I can think of, with very similar results.
0
 

Author Closing Comment

by:sej69
ID: 35087399
Awesome.  That was a GREAT idea.  Helped me find my issue.  Thanks again!
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question