visualstudio.xunit icon indicating copy to clipboard operation
visualstudio.xunit copied to clipboard

Unable to fetch source information for test method in method inherited from .NET Standard library

Open zspitz opened this issue 6 years ago • 3 comments

I have the following test project and references:

Tests.DotNetCore (.NET Core library, C#
    Tests.Common (.NET Standard library, C#)
    Tests.Common.VB (.NET Standard library, VB.NET)

Tests in Tests.Common and Tests.Common.VB are on classes marked as abstract, so they aren't included in test discovery; they are discovered as methods on the instantiable class in Tests.DotNetCore.

When running the tests, for each test in Tests.Common.VB, I get the following in the Output pane:

Error] Unable to fetch source Information for test method: ExpressionToString.Tests.VBCompilerGenerated.JaggedWithBounds contained in project: Tests.DotNetCore

In addition, double-clicking on these tests in Test Explorer doesn't bring me to the source of the test.

Tests written in C# (in the Tests.Common library) don't have these issues:

  • they don't display the error in the Output pane
  • I can navigate to the source by double-clicking in the Test Explorer

zspitz avatar May 06 '19 17:05 zspitz

Hi @zspitz. Does the issue has been resolved? If it's not, then I've got silly question regarding .NET component availability on working machine.

  1. What version of .NET Standard specification your VB.NET project has been implementing and what's version of .NET Core was used for Tests.DotNetCore development?
  2. moreover, VS components might be a reason.

Please contact me on email [email protected] or instagram:yaroslavkostetskiy, telegram:ya_Kostetskiy. As I'd like to add support for xUnit for .NET Standard projects this step would be valuable. We can try solving it together. Thanks

KostetskyiYaroslav avatar Mar 28 '22 13:03 KostetskyiYaroslav

@KostetskyiYaroslav Some time after I first opened this issue, I refactored my tests, and this issue is no longer relevant to me. It may well still be a problem.

zspitz avatar Mar 29 '22 08:03 zspitz

As the source get the test runner working and problematic code didn't get snapshot then the issue should be close per mentioned reasons. Moreover the RC might be related even to class' metadata

KostetskyiYaroslav avatar Mar 30 '22 07:03 KostetskyiYaroslav