views:

39

answers:

3

When I rename a project within a solution, and then try and build that project, I get the error: "The project file "xyz.csproj" was not found. Where xyz is the old project file name!

The annoying thing is that I can search my project & solution for the old project file name, and the search will come up with nothing, and when I click on the error VS does nothing.

So there seems to be no way of finding where the old reference is.

This is a .web project hosting a silverlight page, if that makes any difference.

+1  A: 

With all visual studio projects, you can usually just close visual studio, edit the solution/project files with a text editor, and reopen visual studio. They're just XML. As long as you're careful not to change anything major, a search & replace in a text editor should do the trick.

sunetos
+2  A: 

These are steps I follow when I rename a project:

  1. Click on the project in the solution and rename it. This renames the .proj file and the project name(but not the directory containing the project).
  2. Close solution, rename the project folder. At this stage, the solution still references the old folder.
  3. Open sln file and replace the old folder name with the new one. This should only be in one place. it will look something like this.
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionName", "OldProjectName\NewProjectName.csproj", "{98644DD0-5AB5-4CAC-8D83-CCB8EEEFE234}"

You will need to make it look like this:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionName", "NewProjectName\NewProjectName.csproj", "{98644DD0-5AB5-4CAC-8D83-CCB8EEEFE234}"
Igor Zevaka
A: 

OK this was my problem. I deleted the service reference to the project I renamed, but still got the error message, then via some trial and error adding and removing projects I found that there is a "WCF Ria Services Link" Project property, doh.

That's a bit of a trap.

Grayson Mitchell