0

I need to know how we can control the environment setting in the application without manually changing the setting in app.config in my .net windows application. In Java I would use a command line option (-D parameter) to set the environment when the app launches, example: java -D environment=1 myProgram. Can I use .net SDKs msbuild here? Please let me know if any of these solutions will be applicable in my case:

http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx

http://wallism.wordpress.com/2009/12/21/msbuild-and-multiple-environments/

http://www.c-sharpcorner.com/UploadFile/mgold/MSBuildForXml07282006005222AM/MSBuildForXml.aspx

MSBuild Configuration Files

http://www.timvw.be/2008/03/17/easily-switching-between-appconfig-files-with-msbuild/

Thanks.

Community
  • 1
  • 1
user74042
  • 729
  • 5
  • 14
  • 28

1 Answers1

1

You can find them in then System.Environment class

http://msdn.microsoft.com/en-us/library/system.environment.aspx

Ivo
  • 3,406
  • 4
  • 33
  • 56