formulahendry / vscode-dotnet-test-explorer

.NET Core Test Explorer for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.dotnet-test-explorer
MIT License
204 stars 97 forks source link

Debugger stopped launching after switching project to .net8 #393

Open rolshevskyi-cvet opened 1 week ago

rolshevskyi-cvet commented 1 week ago

Hello, I have a test project on .net6 and execute tests from .Net Test Explorer (v0.7.8) in VS code (1.95.3). After migrating to .net8 tests execute from .Net Test Explorer as before, but if running test in debug mode debugger is not launching at all.

Execution environment:

  1. launch.json targets /bin/Debug/net8.0/MyTestProject.dll
  2. .NET SDKs (8.0.404) - installed after deleting all other versions
  3. .NET runtimes installed: Microsoft.AspNetCore.App 8.0.11, Microsoft.NETCore.App 8.0.11, Microsoft.WindowsDesktop.App 8.0.11
  4. .Net Test Explorer (v0.7.8)
  5. VS code (1.95.3)
  6. NUnit (4.2.2)
  7. NUnit3TestAdapter (4.6.0)
  8. NUnit.Analyzers (4.4.0)
  9. Microsoft.NET.Test.Sdk (17.12.0)
  10. Windows 11

.Net Test Explorer output: image

Thanks in advance for any sort of assist!

rolshevskyi-cvet commented 4 days ago

For anyone how will face the same issue, the following workaround worked for me:

  1. Uninstall '.NET Core Test Explorer' extension
  2. Install 'IntelliCode for C# Dev Kit' extension (C# Dev Kit extension should be enough, but IntelliCode is recommended)
  3. Add the following to .vscode/settings.json: "dotnet.defaultSolution": "<SolutionName>.sln", "dotnet.unitTests.runSettingsPath": ".runsettings", - path to .runsettings file from a solution directory level
  4. Use standard VS Code Test Explorer for running and debugging tests