Skip to content

Unable to use v7 in test projects that are strong named. #198

Description

@martincostello

Describe the bug

Something has changed in v7 that requires the test logging to be compiled against the test assembly, rather than just "being there". As the loggers are not strong-named, this causes compilation to fail for test projects that are strong named:

CSC : error CS8002: Referenced assembly 'Microsoft.VisualStudio.TestPlatform.Extension.JUnit.Xml.TestLogger, Version=7.0.1.0, Culture=neutral, PublicKeyToken=null' does not have a strong name. [/home/runner/work/openapi-extensions/openapi-extensions/tests/OpenApi.Extensions.Tests/MartinCostello.OpenApi.Extensions.Tests.csproj::TargetFramework=net9.0]

It's easy to workaround for tests that do not use [InternalsVisbleTo] by just disabling strong naming in the test projects, but for it is not possible to grant internals access to a strong-named assembly from a test assembly that isn't.

  • Test Framework (choose one): Xunit
  • .NET project version, sdk version: net9.0
  • Command line used: dotnet test --configuration "Release" --logger:junit;LogFilePath=junit.xml
  • OS: All

Expected behavior

Compilation succeeds.

Other details

Additional context

None.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions