Standard C# Doc:
using System;
class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
using System;
class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
}
}
}
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Ah, OK. That sheds some light on the request. I didn't realise that you were asking about adding multiple Main methods to an existing project. Why would VS provide help to do that? It's not something that you would ever want to do in a "real" project. An application can only have one entry point and that is created automatically when you create the project, which is what I assumed you were talking about. I can't imagine any reason that adding more Main methods to a project would be something that occurred often enough that Microsoft would build it into VS. They do provide a way for you to create your own reusable code blocks but you have, for some unknown reason, decided not to use that tool that seemingly does exactly what you want. I can't think why they'd provide another tool to do something that is almost never done but could be done with little effort using the existing tool.Thanks guys, I'm just surprised that it's not in the main set of templates that's all. But that being said I'm using the IDE in an unusual manner. I'm only a beginner so bear with me.
I want all my tutorials/ reference in a single place So I'm going through tutorial by tutorial, creating main functions for each tutorial & saving these in their individual topics. When I've finished I exclude the file from the build process. Create another new file (with a main function) & repeat the process for that tutorial. It's great because I have all topics of each tutorial in a single place; & I'm loving it.
When I need to refresh on a particular topic I turn that file on in the build process & brush up on the particular topic in hand.