Skip to content

Custom Test Logger registration fails silently if the custom logger doesn't have the ExtensionURI attribute #2254

@bakester14

Description

@bakester14

Description

After implementing a custom VSTest logger according to the docs here, trying to register it via Friendly or Assembly-qualified name to VSTest.console.exe fails with a misleading error message.

Steps to reproduce

In a new solution, implement a basic test logger following the instructions in the doc linked above. (No need to implement any event handling, just need an Initialize method to compile.) Name it CustomLogger, give it a FriendlyName attribute like this: [FriendlyName("CustomLogger")], and add <AssemblyName>CustomLogger.testlogger</AssemblyName> to the right place in the .csproj file. Then run the following command: vstest.console.exe <path to any test binary> --testadapterpath:<path to directory where your custom logger binary is> --logger:CustomLogger

Expected behavior

VSTest should run, register the logger correctly, and send events to that logger (if implemented). If I spelled something wrong or got it wrong, it should give a clear error instead about the nature of the problem (in this case, that I didn't implement ExtensionUri).

Actual behavior

VSTest fails with the following error: Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'CustomLogger'.

Diagnostic logs

N/A (I think)

Environment

Version 16.5.0-dev of vstest.console, Windows 10

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