Skip to content

Commit b1d9245

Browse files
ocallespwebreidintroghocalles
authored
Add FAQ entry for TUnit test discovery issue in Test Explorer (#8311)
* Add FAQ entry for TUnit test discovery issue in Test Explorer * Update docs/csharp/cs-dev-kit-faq.md Co-authored-by: Wendy Breiding <[email protected]> * Update docs/csharp/cs-dev-kit-faq.md Co-authored-by: Wendy Breiding <[email protected]> * Update docs/csharp/cs-dev-kit-faq.md Co-authored-by: Wendy Breiding <[email protected]> * Update docs/csharp/cs-dev-kit-faq.md Co-authored-by: Nick Trogh <[email protected]> * Update docs/csharp/cs-dev-kit-faq.md Co-authored-by: Nick Trogh <[email protected]> * Use numbered list in sequential steps --------- Co-authored-by: Wendy Breiding <[email protected]> Co-authored-by: Nick Trogh <[email protected]> Co-authored-by: Osvaldo Calles <[email protected]>
1 parent 0a52a4d commit b1d9245

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/csharp/cs-dev-kit-faq.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ C# Dev Kit requires that it has built your project successfully before tests wil
199199

200200
Build your solution by right-clicking on the solution in the Solution Explorer and select **Build** or `kb(workbench.action.tasks.build)`. Once the build has been completed, your tests will appear in the Test Explorer panel.
201201

202+
### Why are my tests not being discovered or run in the Test Explorer?
203+
204+
If your test project is using the Microsoft Testing Platform (MTP), either via MSTest, NUnit, xUnit v3, or the TUnit test framework, your tests might not be discovered or run in the Test Explorer because MTP differs from the traditional VSTest platform. To resolve this, you need to enable the "Use Testing Platform Protocol" setting in Visual Studio Code to allow the C# Dev Kit to communicate with MTP test projects.
205+
206+
Follow these steps to enable the setting:
207+
1. Open Settings in VS Code: Go to **File** > **Preferences** > **Settings** (or press `kb(workbench.action.openSettings)`).
208+
2. In the Settings search bar, type "Test Window" to filter results.
209+
3. Find the setting Dotnet > Test Window: Use Testing Platform Protocol under the C# Dev Kit extension settings.
210+
4. Check the box to enable it (or toggle it to "On").
211+
5. Reload VS Code by running the **Reload Window** command in the Command Palette (`kb(workbench.action.showCommands)`).
212+
213+
After enabling this setting, your tests should be discovered and run properly in the Test Explorer.
214+
202215
### How do I collect logs for troubleshooting issues with Test Explorer?
203216

204217
If you are encountering issues with Test Explorer, you can enable diagnostic logging to gather more information for troubleshooting:

0 commit comments

Comments
 (0)