Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Allow `dotnet test` to be run from solution directory
<Project>
<Target Name="VSTest">
<MSBuild Projects="@(ProjectReference)" Targets="VSTestIfTestProject" Properties="%(ProjectReference.AdditionalProperties)" />
</Target>
</Project>
<Project>
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
</Project>
@dasMulli

This comment has been minimized.

Copy link
Owner Author

@dasMulli dasMulli commented Nov 15, 2017

For a solution file named any.sln, the targets file containing the VSTest target must be named after.any.sln.targets.

@joaoportela

This comment has been minimized.

Copy link

@joaoportela joaoportela commented Aug 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment