Console Game - wont run on local Visual Studio

Tag - console-game-challenge-project
Link - https://www.codecademy.com/practice/projects/console-game-challenge-project

Hello All,

This is my first time attempting to do a project on code academy, I have downloaded the files from the project and opened them in VS Community, however, when attempting to run I get the following message in my console.

It was not possible to find any compatible framework version
The framework ‘Microsoft.NETCore.App’, version ‘2.2.0’ was not found.

  • The following frameworks were found:
    2.1.22 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    3.1.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:

C:\Program Files\dotnet\dotnet.exe (process 10024) exited with code -2147450730.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.

I have downloaded the latest .NET runtime as you can see but this project is specifically calling for 2.2.0 which is no longer supported, is there a way around this?

Thanks,

Josh

Hi,

Congratulations on completing the C# course!
I just finished and started on the same project. I had the same problem.
This is how I fixed it.

In visual studio:

Click on view, then click soloution explorer.
Click on the spanner icon
Click on application if it is not already selected
Click on the target framework
Change it to .net core 2.2 (or the version it is asking for)

This should then run. I’ve attached some pictures hopefully they’ll make the instructions I’ve provided easier to follow.

You can skip some of the steps if you already have soloution explorer open in visual studio.



Hope this helps