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

Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'GitHubActions'. #5

Closed
hisuwh opened this issue Jun 23, 2020 · 10 comments
Labels
question Further information is requested

Comments

@hisuwh
Copy link

hisuwh commented Jun 23, 2020

I'm getting this error Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'GitHubActions'

I'm referencing Microsoft.NET.Test.Sdk version 16.6.0 which I believe is the latest.

Any tips on how to debug this or what I might be missing?

@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

The dll doesn't seem to be copied to the bin folder which might be why it cannot detect it.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jun 23, 2020

Just to make sure, are you referencing the nuget package in your test project (i.e. not main project)?

Something like this:

https://github.com/Tyrrrz/CliWrap/blob/54abad02376b98bf87b6bef5a62c103362e18107/CliWrap.Tests/CliWrap.Tests.csproj#L18-L24

@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

Yep. Well actually I'm using a common.targets file that my test project is importing. Though I did try referencing it directly also and that did not work either.

I'm using .net core 2.1 and I see you are using 3 - wonder if that is a factor

@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

Ok I've created a simple .NET core 3.1 project locally and I am still getting the same error so that does not seem to be relevant.

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jun 23, 2020

Does it work if you clone the project I linked and run dotnet restore and then dotnet test -l GitHubActions?

@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

ok scrap that I'd missed the import 🤦
It does work with .net core 3.1. And I can see it copies the dll to the output.
So must be something to do with .net core < 3 😞

@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

This is my test project with .net core 2.1 You can see the reference to your package but it does not copy it to the output folder
image

So then when I run the tests it does not see the logger

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jun 23, 2020

Ahh. I think .NET Core 2.1 apps and lower didn't copy their dependencies to the output folder. It can be enabled with a project property:

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

@Tyrrrz Tyrrrz added the question Further information is requested label Jun 23, 2020
@hisuwh
Copy link
Author

hisuwh commented Jun 23, 2020

Just found the exact thing myself 👍
Tested and that works. Thanks for your help and quick responses

@Tyrrrz
Copy link
Owner

Tyrrrz commented Jun 24, 2020

You're welcome!

@Tyrrrz Tyrrrz closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants