Solved

c# Console windows in a WPF application

Posted on 2011-03-09
2
1,141 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now