Why am I getting the error: The operation could not be completed. The parameter is incorrect?

Background to problem:

My game design is simple. I have a GameController script and a Methods script. The GameControler script calls the methods within the Methods script. Works very well.
Yesterday I moved a method from the Methods script to the GameController script (a short method to end my game). I forgot that my GameController script called this GameEnd() method. It was late and I saved the scripts in Visual Studio.
When I went to open the project this morning all hell broke loose. I should have opened the project in safe mode as the opener suggested but I chose Ignore instead. Things looked very bad so I closed everything and reopened using Open In Safe Mode.
I then was able to go in and move the GameEnd() method back to where it was in the Methods script and saved all scripts.
Now, however, I get the following two error warnings in succession:

  1. The operation could not be completed. The parameter is incorrect.
  2. Value does not fall within the expected range.

By turning off Safety Checks in the Jobs menu I was able to get to my scripts and copy them so the coding is safe but the problem persists. I am using Unity 2021.3.11f and the latest version of Visual Studio.

How can I fix this? Thanks forward.

Deleting the .suo file totally fixed the problem. Thank you.

First, when it comes to errors in code you can safely open project without safe mode and i would recommend it for problems like this. If you have scripts content copy it somewhere and try to delete those files, open Unity and add them again pasting code you have copied… If that doesn’t help, just google this problem (c# - Visual Studio: The Operation could not be completed. The parameter is incorrect - Stack Overflow), it is probably vs error, not unity,