visual studio 2012 - How to set the working directory for MS Test projects -
How do I set a working directory for message test projects, such as I can do it for normal application projects ? Some components need to be used to check my component, which are also used by other applications. So far, I have to copy these files to the bin / debug folder of my test project, as this file is expected to be in the working directory.
Is it possible to set up a working directory for test projects? class = "post-text" itemprop = "text">
For those who use Visual Studio 2012, if you set up the output directory of the test project under the project. Build | The outputpath will then become a working directory when you run a test from Visual Studio (because it is using Vstest.console.exe). If you do not want to keep your test DLS, etc. output in the same directory as your directory and you do not want to keep other files in the form of content in your test project (as suggested by Sleasos), then you In a method you can set the path on startup [AssemblyInitialize] attribute. You do this by specifying the system. environment. In general the directory. You probably want to read the work directory as a setting or from the configuration file.
Edit As told by Rohitnet, when you run Run All Tests the default path will be under TestResults . When applying a
runtsing file, the output folder will be the default working directory when you are not using deploymentItems and: -
Comments
Post a Comment