Is it possible to add a console to a form based C# application ? Currently when I do something like
Console.WriteLine("testing");
It appears in output window of the VS2010. I want to know if its possible to attach a console to my windows form application.So that the output appears in the console.
EDIT: Looks like my first question was a bit misleading and it did not exactly specify what I wanted to accomplish. I just added a console to my application using
[DllImport("kernel32")]
static extern int AllocConsole();
However what I really want is the output of log4net console appender to be displayed in that console which is not happening. The xml for my appender is
<appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
<mapping>
<level value="INFO" />
<foreColor value="White" />
<backColor value="Red, HighIntensity" />
</mapping>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%class %date - %message %newline" />
</layout>
</appender>
now when I go like
log.info("Some log");
It still does not display it in the newly added console window. Any suggestions on how i could do that ?