How to make unit test run in bin folder

前端 未结 6 1521
遇见更好的自我
遇见更好的自我 2020-12-18 20:31

I\'m trying to access a file in my solution structure during the unit test. My unit test project has the bin\\Debug\\ as the output directory. So I have written

6条回答
  •  被撕碎了的回忆
    2020-12-18 20:51

    This is an update for anybody who might be running into this problem using Visual Studio 2015. Congruent to @guysherman, I have a Solution Items folder under the Solution file in my Solution explorer, and there should be a .testrunconfig file. If you open it using Visual Studios, Enable Deployment is a checkbox at the top that you can uncheck.

    I had the same problem where my tests were deploying .dll's to a TestRun folder every time I ran the unit tests, but the .config file that was included with the executable references another common.config, which did not deploy with everything else, so I never connected to my SQL server because that was specified in the common.config. Unchecking the Enable Deployment option ran my tests right from the bin folder specified in the project.

提交回复
热议问题