Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Build.RunVSTest fails on multi-targeting test projects #564

Open
AArnott opened this issue Aug 27, 2024 · 0 comments
Open

Microsoft.Build.RunVSTest fails on multi-targeting test projects #564

AArnott opened this issue Aug 27, 2024 · 0 comments

Comments

@AArnott
Copy link
Member

AArnott commented Aug 27, 2024

When a test project defines the TargetFrameworks msbuild property instead of the singular TargetFramework property, msbuild /t:test fails when invoking the RunVSTestTask task because all its inputs are empty.

MSBuild version 17.12.0-preview-24412-02+0716e1c2a for .NET Framework


Static graph loaded in 1.145 seconds: 19 nodes, 102 edges
Loading the following project cache plugin: MSBuildCacheLocalPlugin
Microsoft.VisualStudio.Threading.Analyzers -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.VisualBasic -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.CSharp -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.CodeFixes -> Cache Hit
Microsoft.VisualStudio.Threading -> Cache Hit
Microsoft.VisualStudio.Threading -> Cache Hit
Microsoft.VisualStudio.Threading -> Cache Hit
Microsoft.VisualStudio.Threading -> Cache Hit
Microsoft.VisualStudio.Threading -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.Tests -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.Tests -> Cache Hit
Microsoft.VisualStudio.Threading.Analyzers.Tests -> Cache Hit
C:\.tools\.nuget\packages\microsoft.build.runvstest\1.0.319\build\Microsoft.Build.RunVSTest.targets(19,5): error : Test file path cannot be empty or null. [C:\Users\andarno\source\repos\vs-threading\test\Microsoft.VisualStudio.Threading.Analyzers.Tests\Microsoft.VisualStudio.Threading.Analyzers.Tests.csproj]
  VSTest version 17.12.0-preview-24373-01 (x64)

RUNVSTESTTASK : error : No arguments were specified. [C:\Users\andarno\source\repos\vs-threading\test\Microsoft.VisualStudio.Threading.Analyzers.Tests\Microsoft.VisualStudio.Threading.Analyzers.Tests.csproj]
  Usage: vstest.console.exe [Arguments] [Options] [[--] <RunSettings arguments>...]]

The error goes on to include the full USAGE doc for vstest.console.

Workaround

Specify /p:TargetFramework=net6.0 at the command line and get just one TF tested.

AArnott added a commit to microsoft/vs-threading that referenced this issue Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant