C# Console.WriteLine() Not working Outside of Main()
<p>I apologize if this is a duplicate, but I haven't been able to find any answers to the issue I am having. I'm working with the following block of code:</p>

<pre><code>IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
Console.WriteLine("Interface information for {0}.{1}     ",
        computerProperties.HostName, computerProperties.DomainName);
foreach (NetworkInterface adapter in nics)
{
    IPInterfaceProperties properties = adapter.GetIPProperties();
    Console.WriteLine(adapter.Description);
    Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length, '='));
    Console.WriteLine("  Interface type ... : {0}", adapter.NetworkInterfaceType);
    Console.WriteLine("  Physical Address ........... : {0}",
               adapter.GetPhysicalAddress().ToString());
    Console.WriteLine("  Is receive only.............. : {0}", adapter.IsReceiveOnly);
    Console.WriteLine("             Multicast......... : {0}", adapter.SupportsMulticast);
    Console.WriteLine();
}
</code></pre>

<p>When I run without debugging, and this code is within the Main() method, the <code>Console.WriteLine()</code> prints the output. However, when I put this into a <code>public static void</code> class, the output is blank. Can anyone explain why this happens and what I should do instead. I'm still learning C# so I'm sure this is a beginner's mistake. Any help would be appreciated. </p>