1

I am running MSTest.exe without any problems if I do not specify a /runconfig file. However, as soon as I specify the config file (which is the exact same file, but in a different location), the test outputs the following:

Loading C:\myapp\conf\unit-test-local\App.config...
C:\myapp\conf\unit-test-local\App.config
C:\myapp\conf\unit-test-local\App.config

If I run the command without the /runconfig, it runs properly and displays:

Loading C:\myapp\src\UnitTests\bin\Debug\UnitTests.dll...

It's definitely finding the App.config file because if I purposely type a bad file name, it complains. The App.config in my conf directory is an exact copy of the one that is used if I do not specify the /runconfig.

chaliasos
  • 9,659
  • 7
  • 50
  • 87
Adam Levitt
  • 10,316
  • 26
  • 84
  • 145

1 Answers1

1

/runconfig is not referring to the app.config file but on the *.Testrunconfig

This file contains several settings regarding the way you want your tests to run.

chaliasos
  • 9,659
  • 7
  • 50
  • 87
  • Ah, thanks! Ok, so how do I swap out the actual configuration file that it chooses to use? – Adam Levitt Nov 26 '12 at 17:49
  • 1
    What is the version of your Visual Studio? This setting is no longer used from vs2010. It is replaced by the *testsettings. – chaliasos Nov 26 '12 at 17:53
  • I'm using Visual Studio 2008, and I'm just trying to swap out the location of the application's .config file at run time, rather than use the one that gets generated by the checked out build from svn. – Adam Levitt Nov 26 '12 at 17:55
  • 1
    I am not sure you can do that so simply. You could maybe use the [DeploymentItemAttribute](http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.deploymentitemattribute%28v=vs.90%29.aspx). It will deploy your file (app.config) at the build output folder, but I am not sure that this will work. – chaliasos Nov 26 '12 at 18:01
  • 1
    Ok, thanks. I may just add a build step to my continuous integration server that overwrites the config file as checked out by svn. – Adam Levitt Nov 26 '12 at 18:03