.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

WriteLine - Writing to the VS Output window or to the Console

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :Windows Application
I know the WriteLine activity has a TextWriter argument that can be set to direct where the output is received but how can I have it output into the Output window of Visual Studio? For few tests, it would be helpful when running the test, I could see some output within VS.Blades Don't Need Reloading...

View Complete Post

More Related Resource Links

problems with trace.writeline not writing output messages on multiple instance/thread service



I've come across something strange and can't quite figure out what could be going wrong. I have a windows service which processes queue items in a threadpool (default 5 threads).

So, during testing, i "debug, start new instance" and spin up about 4-5 instances of the service, and on average there is about 25 threads going at same time.

My trace code:
Trace.WriteLineIf(traceOutput.TraceVerbose, string.Format("processing Item for {0}", item.id));


this seems to work for a while and writes the trace code to the output window, but after a while, the trace output just stops being output to the window.. has anyone else experienced this before or could know what might be going wrong?




console.writeline in window 2008 64bit seems very slow


console.writeline in window 2008 64bit seems very slow

any ideas / hints for fixing it.

The following code is running smoothly in XP/32 bit OS.

Have tried build w/ x64 config for testing.

Sample code for test:
using System;
using System.Collections.Generic;
using System.Text;

namespace TestConsole
    class Program
        static void Main(string[] args)

            for (int i = 0; i < 10000; i++)
                Console.Out.WriteLine(DateTime.Now.ToLongTimeString()+": " + i);

Query regarding Console.Writeline()

I was wondering how the Writeline function works and so i went to its definition in the Console Class.But to my amazement i found out that none of the Writeline () methods had a definition (as in the body of the method).So how does the Writeline function really work? Can anyone please help me out with my query.

using pre-processor directives to turn off console.writeline statements?

I have a DOS console application that when processing files will output information to the screen.This is a nice feature when I run the program. But when in production it would somehow be niceto turn of all of my Console.WriteLine statements.  Because unlike my test environment, in production,several hundred files will be processed, and printing out console information will slow my console applicationdown. (I think. You see the console application is set up to run as a scheduled task everyday at 12 noon) So here is my question. Can the console.writilines be turned off in production using C# pre-processor directives?I have read about the Pre-Processor directives, but something is not clicking in regards to how I can apply it.So I am hoping I can apply it in the situation I just described.

writing to view output stream from <% ... %> code


how does the code within the <%  .... %> brackets write to the output stream of a view?

Where view code that looked like the following would write the HTML for a <table> to the output html of the view.

ToViewOutput( "<table>" ) ;
ToViewOutput( "<tr>" ) ;
ToViewOutput("<td>row1. cell 1.</td>") ;
ToViewOutput("<td>row1. cell 2.</td>") ;
oViewOutput("</tr>") ;
ToViewOutput("</table>") ;




Running a WPF application from a console app and return status/console output from the wpf


I am trying to run a WPF application from a console application (e.g. a .bat file) but need to be able to receive console and error output from the WPF application.

I have console.writeline() and console.error.writeline commands in the WPF application but these are not received by the console application.

I would also like to receive a status value from the WPF on completion.

Is this possible?

If so could you give me a simple example using VB?

how to capture url and show the hyperlink button data output in console application


i have an assignment , i have to capture a url which contain some hyperlink btn,  i have to show the hyperlink btn text and their description

How to output wpf window to second VGA card


Hi everybody !

Let's me explain the problem i have.

   My customer computer have 2 graphic cards, and he ask me to write a program in WPF. And that program require 2 seperate window

         First WPF window use for control the second. Both of them need to be out to first VGA card, and the second wpf window need to out to second VGA card.

I have done a lot of search on google and the forum but it's hopeless!

Any solution for my paint ?


Save output tab/window information for debugging project compilation on server


Below is an example of when I run my VB.net project in VS2008, i have an "Output" tab at the bottom that shows some detailed information on what is going on.  My application builds & runs in debug within seconds, but on the server the very first load most mornings takes about 3 minutes.  I'd like to save this "Output" tab information to a text file so that when it runs on the actual server, i can see whats going on.  Maybe even add timestamps to it as well. Could someone please explain how to do this?  Thank you!



------ Build started: Project: C:\...\DMZWebSvc\, Configuration: Debug Any CPU ------

Warning:  - -- - - - --- - - - - - --- - -- -

re-compiling Web Site

Building directory '/DMZWebSvc/App_Code/'.

--------------- - - --- - - - -- - -

Pre-compilation Complete

- - --  -- -  --- - -

Debugger Engine API: Writing a Debugging Tools for Windows Extension, Part 2: Output


Continuing to work on his Debugger Engine extension, Andrew Richards shows you how to avoid all the dangerous traps you might find as you enhance the tool's output.

Andrew Richards

MSDN Magazine May 2011

Writing custom MembershipProvider

ASP.NET Membership mechanism allows to use the build-in server tables to store and retrieve user data. By default, this mechanism can only be used with SQL Server database to which Microsoft provides suitable MembershipProvider class.
Inheriting from this abstract class, developer can use his own table(-es) from any database and use any database engine other than SQL Server, like Oracle, DB2 etc.

10 Tips for Writing High-Performance Web Applications

Writing a Web application with ASP.NET is unbelievably easy. So easy, many developers don't take the time to structure their applications for great performance. In this article, I'm going to present 10 tips for writing high-performance Web apps. I'm not limiting my comments to ASP.NET applications because they are just one subset of Web applications. This article won't be the definitive guide for performance-tuning Web applications-an entire book could easily be devoted to that. Instead, think of this as a good place to start.

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

Writing Custom Web Parts for SharePoint 2007

As I mentioned in an earlier blog post, SharePoint 2007 is built on top of ASP.NET 2.0, which means you can now use ASP.NET 2.0 features (Forms Authentication, Master Pages, Membership, Site Navigation, New Data Controls, etc) when building SharePoint sites. This is true for both the new Windows SharePoint Services 3.0 version (which will be a free download) as well as Microsoft Office SharePoint Server 2007 (which costs money).

Comma-Delimited Output

One of the common tasks performed when retrieving data from a SQL Server database is returning the result as a comma-delimited output instead of a result set. This task can be performed by using a CURSOR selecting the column to be concatenated together. Each row returned by the CURSOR is then concatenated together into a variable separating each one by a comma.

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

XML Reading and Writing

We learned to process XML files using the Document Object Model as implemented by the XmlDocument class. To go further and make XML friendlier, the .NET Framework provides many other classes for different purposes, allowing you to create and manage nodes from custom .NET classes.
Besides the XmlDocument and the derived classes of XmlNode, the .NET Framework provides the XmlTextWriter class, which is derived from XmlWriter. The XmlTextWriter class works in a top-down approach to create, or deal with, the contents of an XML file. This class writes an XML node and moves down without referring
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend