Hello Vikram,
/p>
Can you please explain "The problem can easily be worked with a workaround by using a static constructor, which is fired when the object is accessed first."
/p>
I have a web application which runs both on a shared webhosting and at my home (localhost).
/p>
Of course in both cases the SQL connection string is different (at home I use SQL Server Express while shared hosting uses the "big" SQL Server).
/p>
I only want to have one web.config file (which contains the definition for both the connection strings). The program has to distiguish where it is running. When it runs on the webhosting, it should take connection string 1, otherwise connections string 2.
/p>
My goal is to define a global variable called e.g. "connectionString" which is set at application start (global.asax, Application_Start event).
/p>
As you write in your post HttpContext.Current is not available there. Is there another convenient way to determine where the application runs?
/p>
Thanks for your help.
/p>