Start the following code
Severity level code description project file line suppression state
Error The CS5001 program does not contain the appropriate static 'Main' method at the entry point. Project 26 C:\Users\aozaki hinagi\Documents\Visual Studio 2017\Projects\Project 26\Project 26\CSC1 Active
appears.
using System;
using System.Collections.General;
using System.Linq;
using System.Text;
using System.Net;
namespace Chap5
{
class DnsGetHostAddresses
{
public static void Main (string[]args)
{
// Get Hostname
string hostName=Dns.GetHostName();
// Obtain IP Address List
IPAddress [ ] addresses = Dns.GetHostAddresses (hostName);
foreach (IPAddress address in addresses)
{
Console.WriteLine("Address notation:" + address.ToString());
// Output the byte array of IP addresses across
Console.WriteLine(
"Byte column: {0}\n", string.Join(", ", address.GetAddressBytes()));
}
Console.ReadKey();
}
}
}
However, I don't understand the error if I don't include the main.
Could someone tell me?
Thank you for your cooperation.
c#
In my experience, when I have the above questions, the build action is often changed by some impetus.
Please check the following.
© 2024 OneMinuteCode. All rights reserved.