Skip to content

How can a non-test class-library reference IXunitTestCaseDiscoverer in v3? #3275

@martin-tnc

Description

@martin-tnc

The problem

  • We have built an internal logging/extensibility library that wraps xUnit.
  • In xUnit v2 we referenced xunit.extensibility.core/execution and implemented our own
    IXunitTestCaseDiscoverer.
  • After upgrading to v3.1. I can no longer compile because the interface
    only exists in xunit.v3.core, and that package now forces the project to be an
    <OutputType>Exe</OutputType> test project.

I’ve read #3157 and the package-layout doc, and I understand that library projects should now reference xunit.v3.extensibility.core instead of xunit.v3.core.
Unfortunately, that package does not appear to surface IXunitTestCaseDiscoverer (or any of the discovery interfaces).

What I’ve tried / references

Questions

  • Which package is intended to expose IXunitTestCaseDiscoverer (and friends) for library authors in v3?
  • If it should come from xunit.v3.extensibility.core, is the interface perhaps marked internal by mistake, or missing a type-forward?
  • Is there an official way to suppress the build-time “must be executable” check when xunit.v3.core is referenced from a class-library (e.g., an IsTestProject MSBuild property)?

Many thanks for any pointers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs ReproThis issue needs a repro project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions