Not picking up xUnit tests

kristian's Avatar


01 Feb, 2019 08:59 AM

All projects are built successfully, but AppVeyor is unable to find the tests automatically:

Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
  SpaFallback -> C:\projects\middleware\src\SpaFallback\bin\Release\netstandard2.0\Hellang.Middleware.SpaFallback.dll
  SpaFallback.Tests -> C:\projects\middleware\test\SpaFallback.Tests\bin\Release\netcoreapp2.2\Hellang.Middleware.SpaFallback.Tests.dll
  Authentication.JwtBearer.Google -> C:\projects\middleware\src\Authentication.JwtBearer.Google\bin\Release\netstandard2.0\Hellang.Authentication.JwtBearer.Google.dll
  ProblemDetails -> C:\projects\middleware\src\ProblemDetails\bin\Release\netstandard2.0\Hellang.Middleware.ProblemDetails.dll
  ProblemDetails.Tests -> C:\projects\middleware\test\ProblemDetails.Tests\bin\Release\netcoreapp2.2\Hellang.Middleware.ProblemDetails.Tests.dll
  ProblemDetails.Sample -> C:\projects\middleware\samples\ProblemDetails.Sample\bin\Release\netcoreapp2.1\Hellang.Middleware.ProblemDetails.Sample.dll
  RateLimiting -> C:\projects\middleware\src\RateLimiting\bin\Release\netstandard2.0\Hellang.Middleware.RateLimiting.dll
  RateLimiting.Tests -> C:\projects\middleware\test\RateLimiting.Tests\bin\Release\netcoreapp2.2\Hellang.Middleware.RateLimiting.Tests.dll
Discovering tests...OK
Build success

The test projects don't directly reference xunit as all the test dependencies are part of a Directory.Build.props file further up in the directory hierarchy:


    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="xunit" Version="2.4.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />

    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />

The test projects themselves are prettey simple:

<Project Sdk="Microsoft.NET.Sdk">
    <ProjectReference Include="..\..\src\ProblemDetails\ProblemDetails.csproj" />

Is this not a supported scenario? Do I have to copy over the dependencies into each project file for AppVeyor to detect unit test projects?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 01 Feb, 2019 08:14 PM

    Ilya Finkelshteyn's Avatar

    Yeah, right now we are looking for direct references in project files. Please watch for the fix. For now you can add references just to make AppVeyor recognize test projects or (clear approach), use test script mode and call dotnet test with appropriate switches.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac