NETFramework,Version=v4.5 were not found


I’ve just started the Ultimate C# part 2 and downloaded the source code.
I’m running Visual Studio 2022 with version 6 of dotnet.
When I F5 the first CSharpIntermediate\Program.cs in the solution I get the error in the title.
Can this be updated or do I need to install something else.
i.e. a lower version of Visual Studio Code or different version of dotnet.

What is the best way to solve the above error.



You can always download a .net version. Links are here: Download .NET Framework | Free official downloads - choose a “development pack version” or “sdk” version if you are a developer, or a “runtime” version if you just want programs to work (of course you are in the first category). Net 4.5 is really out of support now - however, if you need it you can use it for the course (I would avoid it otherwise).

I’d try to port that code to .NET 6 as much as possible.
Can you give other error messages you are getting?
Now 1st thing to try is update the target framework in properties and see if the message remains or not.

I came to the same conclusion earlier today.
It will be a useful exercise to help my development.

I’m going to have a go at it tomorrow.