-->

Monday, June 17, 2013

How to set Startup Object in multiple main method in c# console application

How to set Startup Object in multiple main method in c# console application

Suppose you have a project that it contain multiple main method in different classes Then How to set start-up object
your code are :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
    class program1
    {
        static void Main(string[] args)
        {
        }
    }

}

After run your application you get error 
more than one main method in application


Following some steps for solution:

Step-1 : On Application name, Select properties


Step-2: Select Application tab in left pane, Choose Startup object in right pane

startup object

Step-3: After choosing startup object run your application

output screen








Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved