Configuration Files & NUnit

This post was originally published at http://solepano.blogspot.com

When using an application configuration file (App.config) in a nunit library application project, the following post build event is needed to copy the config file to the target directory:
copy "$(ProjectDir)App.config" "$(TargetPath).config"
Once this is done, we can access any configuration item through:
System.Configuration.ConfigurationSettings.AppSettings["myConfigItem"]
 

No Comments