M
M
Maxim2016-08-20 13:52:00
.NET
Maxim, 2016-08-20 13:52:00

CS5001. Does the program not contain a static "Main" method suitable for the entry point?

program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    static class Program
    {
        /// <summary>
        /// Главная точка входа для приложения.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

it is.
public Form1()
        {
            InitializeComponent();
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2016-08-20
@Got_Oxidus

In the project properties, set the entry point
And yes, add public for the class and for the Main method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question