निम्नलिखित सी # प्रोग्राम (csc hello.cs
के साथ बनाया गया) कंसोल पर Hello via Console!
प्रिंट करता है और डीबग व्यू विंडो में Hello via OutputDebugString
प्रिंट करता है। हालांकि, मैं System.Diagnostics.*
कॉल में से कोई भी नहीं देख सकता। ऐसा क्यों है?System.Diagnostics.Debug.Write आउटपुट कहां दिखाई देता है?
using System;
using System.Runtime.InteropServices;
class Hello {
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
public static extern void OutputDebugString(string message);
static void Main() {
Console.Write("Hello via Console!");
System.Diagnostics.Debug.Write("Hello via Debug!");
System.Diagnostics.Trace.Write("Hello via Trace!");
OutputDebugString("Hello via OutputDebugString");
}
}
क्या csc
के लिए शायद कुछ विशेष कमांड लाइन स्विच आवश्यक हैं?
मैं अपने किसी भी विकास के लिए विजुअल स्टूडियो का उपयोग नहीं कर रहा हूं, यह शुद्ध कमांडलाइन सामान है।
की जाँच करें, माइक्रोसॉफ्ट के (SysInternals) DebugView उपयोग कर सकते हैं: http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx –