Can't select the Primary method as the startup object in Visual Studio Express 2010?

I wrote a Main method in one of my classes. My startup object says Not set. When you click on it, nothing is displayed in the drop-down menu. Why can't I choose the main method for my launch object? I want to start my main method only by pressing ctrl + F7, but nothing happens. Below is a very short Main method that I use.

static void Main(string[] args)
{
    Program c = new Program();
    c.consoleread();
}
+5
source share
4 answers

public, static (Shared VB.NET) : void, int, string.

, .

+4

. .csproj:

<PropertyGroup>
  <StartupObject>MyNamespace.MyClassWithMain</StartupObject>
</PropertyGroup>
+4

VS !

: .net 4.5.1 Service, Console. " " - . .csproj .

+1

VB.NET

Project → {ProjectName} →

, Main. :

The launch object must be a form when the "Enable application framework" checkbox is checked.

Furthermore, after removal of the mark, the label is changed from Forms start to run object .

Error dialog:   https://i.imgur.com/zczkEKz.png

0
source

All Articles