views:

188

answers:

2

I really want to put in some sort of section handler into App.config that will execute some code before the application actually starts executing at Main. Is there any way to do such a thing?

+1  A: 

Why dont you put that call as the first instruction in your main function?

Otherwise you can define another entry point for your program and call your main from there but its basicaly the same

Eric
+1  A: 

Not sure what you're trying to accomplish...but, I'm not aware of anyway you can have a console application run any other method before Main(). Why not do something like this:

static void Main(string[] args)
{
    //read your app.config variable
    callAlternate = GetConfigSettings(); 
    if(callAlternate)
        AltMain();

    ///...rest of Main()
}
Ricardo Villamil