14

Anyone ever had this error when trying to build a solution in Visual Studio 2008?

It's driving me MAD! I've removed all the containing projects and re-added them, and it's still not letting me build or run the solution.

Any suggestions?

3
  • Are you trying to build a new project or an existing one? Can you give more detail..
    – Malcolm
    Commented May 7, 2010 at 10:36
  • Existing solution, just removed a couple of projects that no longer exist from it and VS went a bit mental!
    – Ed James
    Commented May 7, 2010 at 10:37
  • 1
    Can't Microsoft do any better? Like, how about giving some indication of which project is broken? I've lost countless hours due to Visual Studio (and C++) bugs or bad behavior. Commented Aug 2, 2013 at 18:11

7 Answers 7

9

If you open the solution file (SolutionName.sln) in a text editor you should a couple of lines something like these for each project:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F89EFBC}") = "ProjectName", "ProjectName\ProjectName.csproj", "{6B887D8C-D874-4AB2-B2CC-3551DEA2CC83}"
EndProject

There may be more stuff in between those lines, or in this case they may corrupt in some way. If you can isolate the problem entry and remove it you may be able to resurrect the solution.

5
  • 1
    There's just the two named projects that I expected, and some global info, no extra project without a name...
    – Ed James
    Commented May 7, 2010 at 10:47
  • If you create a new solution and add the existing projects to that does it work? Commented May 7, 2010 at 10:52
  • No idea, how do you make a new SLN from scratch without starting with a project?
    – Ed James
    Commented May 7, 2010 at 11:01
  • or you can just open one of the project.csproj files in a new copy of VS and it will create a solution for it Commented May 7, 2010 at 11:04
  • 7
    nvm, fixed it: removing a project didn't remove the reference to the assembly from another project, this seems to confuse VS. Worst error message ever I think :D
    – Ed James
    Commented May 7, 2010 at 11:09
8

I spent a couple of hours on this error yesterday and fortunately got to the bottom of it.

We had a project file, let's just call it ProblemProj.vcxproj that was originally included in SolutionA.sln and compiled fine. The project was then added to a different solution, SolutionB.sln, and compiled fine in that solution. However, after returning to SolutionA, the "project file '' has been renamed" error started happening.

This happened because VS2010 decided to change the ProjectGUID of ProblemProj.vcxproj. The SolutionB.sln referenced the correct GUID, but SolutionA.sln still had a reference to the old GUID.

You can find it in the .sln file looking something like this:

< ProjectGuid >{271F161A-F26F-41D1-BDC8-FCF912A2F4FB}< /ProjectGuid >

The problem can be fixed in the following ways:

1) Manually edit the GUID inside SolutionA.sln by opening it up in a text editor and looking for the above markup.

2) Remove the project from SolutionA.sln and re-add it; this caused it to pick up the correct GUID and fortunately didn't decide to change it again.

3) Revert the GUID change in ProblemProj.vcxproj (which will then cause the exact same error to happen in SolutionB, so I wouldn't recommend this unless SolutionB doesn't matter to you anymore).

Hope this helps.

5

The accepted solution here did not solve it for us. The .sln file had the correct path to the project. Instead, it turns out someone had pushed the .sln.cache file into git and it had the wrong path to the project. We deleted the .sln.cache file from the computer and the build worked fine. To prevent it in the future, we removed the .sln.cache file from git, added *.sln.cache to the .gitignore file.

2

I just encountered the same error in VS 2012 with a slightly different cause, after loading a solution that VS 2010 had seemed happy with.

Turns out a single C++ project in the solution had a reference to an unnamed project (just a Guid; no name, no path). While ever this project was loaded it was impossible to build, clean, or show references for ANY of the projects in the solution. I discovered which project had the bad reference by unloading projects from the solution until it stopped complaining.

0
1

Go to your Projects Referencies and check if one of those referenced projects are with a label (unavailable).

Remove this reference and add it again.

It ocurred to me, and this is how I found the solution to fix this problem.

1
  • Thanks... your hint has solved my problem. In this case was that the project was referencing other project that was not in the solution. irealized about that by looking at project references.
    – jstuardo
    Commented Mar 1, 2015 at 3:05
0

Nuke the SDF. I tried checking all the GUIDs and references with no success. I deleted the solution's SDF file and it cleared up. (The SDF is an automatically generated database file.)

-1

This error can be generated in VC2012 from multiple problems. In my case, the error occurred because I had not added all project dependencies to the project tree. So for example, I am working on a program, let's call it MyProgram, which uses functions from Library A. The Library A project is added to the project tree. However, the project Library A depends on functions included in Library B. If the Library B project is not added to the project for MyProgram, this error will be generated when I try to compile and link. Adding the Library B project will fix this problem.

I guess technically the error message is correct but this problem would be easier to diagnose with a more detailed error message, like "Library A dependencies missing from project MyProgram".

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.