- open Developer Command Prompt for VS2017 (Opened it as admin)
- Input the command "gacutil /u Microsoft.Build.Framework". to uninstall the Microsoft.Build.Framework from Global Assembly Cache [GAC]
- Then input the command: gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll" to reinstall the 15.1.0 version.