I had the same issue in a .NET Framework project. I was using VS2022.
Before trying this please keep backup of the files you are editing.
Still unaware why this happened suddenly. But the following worked for me.
- Remove the project from the solution list in visual studio
- Go to the solution (.sln) file and open it in an editor
- Remove the entries that you have for your project which can't be loaded.
Example :
Remove the following that is right before GlobalSection :
Project("{FCA04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web", "Web\Web.csproj", "{5CA8CA45-47D0-4AC8-9BDF-2030B751CC10}"
EndProject
Also remove the followings from the GlobalSection :
{5CA8CA45-47D0-4AC8-9BDF-2030B751CC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CA8CA45-47D0-4AC8-9BDF-2030B751CC10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CA8CA45-47D0-4AC8-9BDF-2030B751CC10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CA8CA45-47D0-4AC8-9BDF-2030B751CC10}.Release|Any CPU.Build.0 = Release|Any CPU
- Close Visual Studio.
- Open Visual Studio in administrator mode.
- Add existing project.
It should work now.