vscode-dotnet-test-explorer
vscode-dotnet-test-explorer copied to clipboard
C#: Could not find test (no symbols found) in .Net Core 3.1
When clicking on a test in .Net Test Explorer, it shows
C#: Could not find test (no symbols found)
If I try to rerun the test, its continuously loading instead of rerunning
This issue is only happens in C# .Net Core 3.1. Everything works properly in C# .Net Core 2.2
Related Issue but it is for F#: https://github.com/formulahendry/vscode-dotnet-test-explorer/issues/228
Dotnet SDK Version: 3.1.100
Unit test framework and relevants versions of that:
Package | Version |
---|---|
Microsoft.NET.Test.Sdk | 6.4.0 |
Moq | 4.13.1 |
MSTest.TestAdapter | 2.0.0 |
MSTest.TestFramework | 2.0.0 |
Also having it happen. Here's the logs:
Could not find test (no symbols found) Test run for XXX.Api.Tests.IntegrationTests.V1.Content.XXXControllerTests.Create_Success, expecting 1 test results file(s) in total Executing dotnet build in d:/Repos/XXX/Api/Api/IntegrationTests Executing dotnet test --no-build --logger "trx;LogFileName=C:\Users\XXX\AppData\Local\Temp\test-explorer-sJg6gd\0.trx" --filter "FullyQualifiedName=XXX.Api.Tests.IntegrationTests.V1.Content.AssessmentControllerTests.Create_Success" in d:/Repos/XXX/Api/Api/IntegrationTests Process 4636 started Waiting for debugger to attach
I am also having this issue.
The issue seems to stem from having tests in an abstract class for me. My setup is:
Package | Version |
---|---|
xunit | 2.4.1 |
xunit.runner.visualstudio | 2.4.1 |
Microsoft.Net.Test.SDK | 16.6.1 |
Once I changed the abstract class to a normal class, Test Explorer picked up on the tests and was able to navigate to them without the "no symbols found" warning.
For me, this isn't a big issue, at the moment. However, if my team and I decide to expand these tests to span multiple database contexts (see this tutorial with this sample code) this could be an issue.
@ska737 Ah interesting, thanks for providing that information.
It appears that tests defined in abstract classes are not discovered by the underlying test framework, which from a class perspective makes sense. Once you have something inheriting your abstract class those tests should show up on that inheriting class.
Do we have any updates to fix or workaround?
Any news about this? I'm having this problem too, but I do not use abstract class....
Me too...
Any workaround to this? .NET Test explorer
sometimes runs a test fine, but "Go to test" fails with "no symbols found" error. It discovers them (so it knows they exist and where), so it'd make sense it can also go there.
Some tests are discovered, but trying to run them leads to "no symbols found". Next to impossible to use the .NET Test Explorer, unfortunately.
having the same issue as @abelbraaksma, it runs the tests but if i want to go to them or debug them with the .Net Test explorer it leas to "no symbols found"
Same problem here in 2023... Have you guys found a solution ?
Same problem