If this has suddenly started happening, especially after changing project debug settings, and not fixed by reversing the changes. This can be caused by a corrupted .vs hidden folder (in the solution folder). If this is the case, simply deleting that folder fixes it.