Solved

c# Console windows in a WPF application

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

929 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