So I’m building a very basic solution to practice msbuild. It has a library, website, and test project. I learned that I can create a task to run mstest to run all my tests.
But I noticed in tfs build it will automatically find tests if you want it to and run them.
I read about Desktop builds that looks compelling as well.
So as I work on my project locally it seems to me I would need a task AfterBuild that will run my tests for me.
But after I check it in the TFS Build will execute the tests automatically. So does this mean that my tests will run twice? Once because it’s a task I created and second because the TFS build will run it. Does this make sense?
You should be able to use a condition
Condition=” ‘$(IsDesktopBuild)’ != ‘true’"to fix this.See details on the following blog post http://www.morkeleb.com/2008/11/16/running-tests-in-desktopbuild/