There are lot of close related questions with this bug/problem.
I have searched these:
Upgraded to .NET 4.5, now "value does not fall within the expected range"
Visual Studio 2019 Value does not fall within the expected range when reloading web project
There are other questions outside of SO about problems with the same message, but the situation they appear are not the same as mine, like this one.
So, here is my problem: I got a client who has a really big solution, with projects using overral, v4.6.2 of the SDK. In this solution, there are WCF projects, WebApi, UnitTest, Class Library and Console projects. All under the same solution. It's kinda of a mess.
When I open it originally, some projects fail to load. When I try to reload the project, it shows the error in case.
What I've tried so far:
- Clearing the solution
- Deleting all bin and obj folders, closing VS and opening again;
- Doing the same above, but running as Admin;
- Uninstalling all other SDK versions, and installing only the specified version;
- Updating VS;
- Executing step 1, 2 and 3 after the update;
- Uninstalling VS, build tools, removing the folder, reinstalling everything as admin, with the sdk's included. And I installed mostly ALL the options, just to be extra sure.
- Executing step 1, 2 and 3 after the reinstall and a restart.
Finally, I did try what is in this question's answer:
"Value does not fall within the expected range" when trying to add a reference in a project
To no avail. devenv executes successfully, but the error persists. There is no output throw in the output window. I did not find any relevants logs of the error.
To add more details, 6 projects won't load. Other 14 loads up just fine.