Last active
January 18, 2021 16:55
-
-
Save dasMulli/6fb5d1f507b886aeebaf27069f47f895 to your computer and use it in GitHub Desktop.
Allow `dotnet test` to be run from solution directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project> | |
<Target Name="VSTest"> | |
<MSBuild Projects="@(ProjectReference)" Targets="VSTestIfTestProject" Properties="%(ProjectReference.AdditionalProperties)" /> | |
</Target> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project> | |
<Target Name="VSTestIfTestProject"> | |
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" /> | |
</Target> | |
</Project> |
Your blog post, that explains how this works:
https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For a solution file named
any.sln
, the targets file containing theVSTest
target must be namedafter.any.sln.targets
.