Anysphere C# extension - Test runner/discovery unstable

I am taking the Anysphere C# extension for a test drive. It seems very unstable unfortunately. I am testing it on an M4 Mac with the GitHub - JamesNK/Newtonsoft.Json: Json.NET is a popular high-performance JSON framework for .NET repository.

A few things that don’t seem to work well:

  1. Test discovery/test runner:

Notice how in one file there’s Intellisense, but the other doesn’t have it. These files are right next to one another.

  1. Clicking “Debug test” does not work. It results in an error like this:
Starting test discovery
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find 'dotnet' host for the 'X64' architecture.

You can resolve the problem by installing the 'X64' .NET.

It doesn’t seem possible to set the .NET SDK that the extension itself runs under.

Debugging these tests in VS Code works without issue:

It would be great if there was some additional logging that could be enabled, or if the extensions were open source in some way so we could try fixing this ourselves.

Happy to help fix these issues!

Thank you!

1 Like

cc @ravirahman

Hi @NatElkins, thank you for sharing these issues.

For the test explorer you might need to use another extension. It sounds like some other users are using “.NET Core Test Explorer” or “DotRush”. Could you try giving one of these a try?

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find ‘dotnet’ host for the ‘X64’ architecture.

Would it work to set the .NET sdk explicitly in the .csproj file?

Hi,

Thank you for responding!

None of those worked unfortunately. Also, one thing about that repo is that it supports a TON of .NET frameworks due to its ubiquity and age.

I think I’m just going to use VS Code for now, but if you’re looking for a very well-known open-source .NET project to benchmark and dogfood against, GitHub - JamesNK/Newtonsoft.Json: Json.NET is a popular high-performance JSON framework for .NET is a great one.