I want to run unit tests using MSBuild. This is how I call msbuild today:
msbuild MySolution.sln
Instead, I want to use the MSBuild project file named "MyBuild.proj" as follows:
<?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5" DefaultTargets="Build"> <Target Name="Build"> <ItemGroup> <SolutionToBuild Include="MySolution.sln" /> <TestContainer Include="..\Output\bin\Debug\*unittests.dll"/> </ItemGroup> </Target> </Project>
And then call this command line:
msbuild MyBuild.proj
For some reason, when I do this, the command immediately ends, and the build does not even happen. I am afraid that I should miss something very obvious, as I am new to MSBuild.
I suppose I really have 2 questions:
- Why doesnโt this even create my solution.
- Is the "TestContainer" element correct for performing my tests.
Thanks!
source share