locked
Where do I place the .runsettings file? RRS feed

  • Question

  • I asked How can we ignore some files when calculating code coverage? and got great feedback. Now I've got another question. I understand that I can use a .runsettings file in order to specify what files to exclude. What I don't know is, where does that .runsettings file go? Do I put it into the project I'm testing with unit tests? Or does it go into the unit test project itself? And at what level in whatever project?

    Rod

    Monday, October 31, 2016 5:24 PM

Answers

  • Hi Rod,

    >>What I don't know is, where does that .runsettings file go?

    By default the .runsettings file has been placed in the solution folder. We could get the runsettings file via creating a XML file and change it to .runsettings file. Then the file will be exist in the solution folder. Please refer to the following screenshot:

    >>Do I put it into the project I'm testing with unit tests

    I suggest you put it in solution folder by default, just like the following screenshot:

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rod at Work Tuesday, November 1, 2016 2:09 PM
    Tuesday, November 1, 2016 9:21 AM

All replies

  • Hi Rod at Work,

    According to your description, if we have a .runsettings file for unit test. We could use it in two places:

    1). In VS IDE, we could use the .runsettings file from clicking Test menu->Test Settings->Select Test Settings File-> choose your .runsettings file. Please refer to the following screenshot:

    2). We could run test from the command line, and specify the .runnsettings file.

    Here is a MSDN document about how to run test command from the command line with VSTest.Console.exe:

    https://msdn.microsoft.com/en-us/library/jj155796.aspx

    We could use the /settings: switch to specify a .runsettings file.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 1, 2016 2:42 AM
  • Hi Rod,

    >>What I don't know is, where does that .runsettings file go?

    By default the .runsettings file has been placed in the solution folder. We could get the runsettings file via creating a XML file and change it to .runsettings file. Then the file will be exist in the solution folder. Please refer to the following screenshot:

    >>Do I put it into the project I'm testing with unit tests

    I suggest you put it in solution folder by default, just like the following screenshot:

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Rod at Work Tuesday, November 1, 2016 2:09 PM
    Tuesday, November 1, 2016 9:21 AM
  • OK Oscar, that's where I'll put it. Thanks.

    Rod

    Tuesday, November 1, 2016 2:09 PM