How to fix: Add a reference to “.NETFramework,Version=v4.7.1” in the “TargetFrameworks” property of your project file and then re-run NuGet restore?

I tried to port my projects to .net 5.0 and encountered this problem when reverting back to 4.8. This worked for me:

  1. Clean project
  2. Delete bin and obj folders
  3. Builds again.

Leave a Comment