Skip to content

Use Testing platform server mode breaks testing #4808

Closed as not planned
Closed as not planned
@daryllabar

Description

Describe the bug

Upon updating to the latest version of VS, my test explorer has stopped running tests.

Steps To Reproduce

Enable Use Testing platform server mode

Expected behavior

My tests run

Actual behavior

Here are the logs:

[1/27/2025 11:53:08.392 AM]  Launching test runner 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.dll'
[1/27/2025 11:53:08.393 AM]  Logging diagnostics under 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\Log'
[1/27/2025 11:53:08.393 AM]  Created TCP listener with port 0 for program 1
[1/27/2025 11:53:08.394 AM]  Starting test runner 'C:\Program Files\dotnet\dotnet.exe C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.dll  --server --diagnostic --diagnostic-verbosity Debug --diagnostic-output-directory "C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\Log" --results-directory "C:\_dev\MyClient\dynamics-box\CRM\Server\TestResults" --client-port 50491'
[1/27/2025 11:53:08.409 AM] [Error] Unable to connect to testing platform runner process 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.dll'.

When trying to run the test in the command line, I get a different error, not sure if it is because I need to start a TCP listener first?

C:\Users\Me>"C:\Program Files\dotnet\dotnet.exe" "C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plug
in.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.dll"  --server --diagnostic --diagnostic-verbosity Debug --diagnostic-output-directory "C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\Log" --results-directory "C:\_dev\MyClient\dynamics-box\CRM\Server\TestResults" --client-port 50491
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\'.
Failed to run as a self-contained app.
  - The application was run as a self-contained app because 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.runtimeconfig.json' was not found.
  - If this should be a framework-dependent app, add the 'C:\_dev\MyClient\dynamics-box\CRM\Server\MyClient.Dataverse.Plugin.Tests\bin\Debug\MyClient.Dataverse.Plugin.Tests.runtimeconfig.json' file and specify the appropriate framework.

Additional context

I'm testing a .Net 4.6.2 project with the following nuget packages with "test" in their name installed:

Image

Unchecking the preview feature and restarting VS resolves the issue.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions