I've encountered this issue as well. By chance, I deleted the previous StepDefinitions.cs file and then rebuilt the entire project, which resolved the issue.
I also tried many times. Sometimes simply rebuilding the project works, while other times I need to delete the previous StepDefinitions.cs file
My suggestion is to back up your previous StepDefinitions.cs files, then delete all of them, rebuild the project, and restore them afterwards. This might temporarily fix the issue.