This was quite dramatic as my DB connection strings are stored as settings, and needed these to produce tests against the data. The simpliest way to solve this problem is to add a post-build event to the test project. This psot build event will copy the configuration file to the target destination. The testing suite will then pick up these settings as and when requested.
1. Right click and properties on the test project
2. Click Build Events Tab.
3. Add the following post build event...
copy /Y "$(ProjectDir)app.config" "$(TargetPath).config"
This will ensure your config file is copied to its destination, where your test suite (I.e. NUnit can pick it up).
4 comments:
A friend in need is a friend indeed. ....................................................
看到你的好文章真是開心 加油囉.......................................
喜樂的心是健康良藥,憂傷的靈使骨枯乾。........................................
hello~來拜訪你囉~部落格很棒^^!..............................
Post a Comment