Unit tests cannot run

ammamm 0 Reputation points
2025-01-28T14:45:03.52+00:00

What is causing this error?

Building Test Projects

Starting test discovery for requested test run

========== Starting test discovery ==========

You must install or update .NET to run this application.

App: C:\Users\Support\source\Workspaces\Workspace\E.Tests\bin\Debug\net8.0\testhost.exe

Architecture: x64

Framework: 'Microsoft.NETCore.App', version '8.0.12' (x64)

.NET location: C:\Program Files\dotnet\

The following frameworks were found:

8.0.11 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
357 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 30,816 Reputation points Microsoft Vendor
    2025-01-29T06:18:38.52+00:00

    Hi @ammamm

    Welcome to Microsoft Q&A! 

    You need to manually install the version ‘8.0.12’ (x64).

    Download .NET 8.0 (Linux, macOS, and Windows) 

    After installation, you can open the Command Prompt and run the following command to see if Microsoft.NETCore.App 8.0.12 is installed.

    dotnet --list-runtimes 

    Then, you can run your project again. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.