Also had this problem - uninstalled/installed everything many times - sometimes worked, sometimes not.
But: this one from @bennyball worked, Thanks!
bennyball Mar 21 '18 на 10:22 PM
Solved ! The problem was in :
Edit → Editor preference → Source code
and I changed “Visual Studio Code” to “Visual Studio 2017”. Then file → refresh Visual Studio worked ! Then close and reopening UE