It's not possible if you compile using Visual Studio IDE but possible via
command line compilation
Compile from command prompt using csc.exe and /main switch specifying your
class ( which you want as entry point since there can only be one entry
point in an exe)

using System;
class Test
{
    public static void Main()
    {
        Console.WriteLine("Test");
    }
}

class Demo
{
    public static void Main()
    {
        Console.WriteLine("Demo");
    }
}

csc Hello.cs /main:Demo        --> In order to choose Main from the Demo
class

and

csc Hello.cs /main:Test      --> In order to choose Main from the Test class

On Thu, Jun 2, 2011 at 5:59 AM, Stephen Russell <[email protected]>wrote:

> On Wed, Jun 1, 2011 at 8:05 AM, John <[email protected]> wrote:
> > cate,
> >  Cerebrus is correct for Visual Studio.  Now if you were doing C
> > development, you could in theory make a Build file that would compile
> > each of the classes you have the Main method in but in either point in
> > case you would have to develop a build segment for each of those
> > classes in the build file.
> >
> > Ultimately, you are either going to have to build a DLL library file
> > and consume the classes from there with a Interface that consumes the
> > class that you want for the duration of that session or have several
> > projects that get compiled into EXE applications.
> ---------------
>
> Or pass in a param in startup to do the action you want.
>
> Dir
> Dir /s
>
>
>
> --
> Stephen Russell
>
> Unified Health Services
> 60 Germantown Court
> Suite 220
> Cordova, TN 38018
>
> Telephone: 888.510.2667
>
> 901.246-0159 cell
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to