How not to build before executing unit tests in Visual Studio 2010

后端 未结 3 1339
长发绾君心
长发绾君心 2021-02-12 03:33

Whenever I run unit tests, Visual Studio builds to make dlls and exes even when I modified nothing in code.

How can I make so that Visual Studio doesn\'t build when I d

3条回答
  •  花落未央
    2021-02-12 04:36

    This is an old question, but I keep seeing people ask it and the issue is still true in VS2017, and it's also true of other test frameworks (Xunit, etc) run from within VS.

    The way to do it is to not run your tests from within VS, but from within the console runner. This doesn't change the behavior of VS, but circumvents it. If you aren't in VS, then it can't recompile. If you're using ReSharper, as Brett says, it has one.

    If you aren't using ReSharper, for MSTest, you can start here. https://msdn.microsoft.com/en-us/library/ms182489.aspx

    If you aren't using ReSharper, for XUnit, you can start here. https://xunit.github.io/docs/getting-started-desktop.html#add-xunit-runner-ref

提交回复
热议问题