Tried all solutions in posts, they all failed separately. But the following combination worked finally: Close all tabs > Clean solution > Close VS > Delete bin and obj folders in project > Open Vs > Build solution.