We have a VS2008 solution and i\'ve noticed something weird happening:
some projects refer other projects that are defined in the same solution (added as project ref
This happens if you have two projects with the same guid in the same solution, VS will assign a new guid to one of them. And that can be happen when a new solution with a new Project is build and if you insert shared projects they may have a guid that is the same like the new project. The problem is that all other solutions which have also the shared project already inserted have to change the guid again and thats annoyingly.
A simple Solution instead of editing the solution-/project-files by hand: Just remove the projects and then insert the shared projects FIRST and AFTER THAT insert the NEW project. So VS gives a new - not duplicate - guid to the new project and is not forced to change the guid of the shared projects.
... so much for the topic "Globally Unique Identifier" ;-)
Regarding the workaround: the GUID may be referenced several places in the solution file (.sln). Remember to replace all references to this GUID, not just the one mentioned in the workaround (workaround is locked - unable to leave a comment there, so I had to answer this post instead).
The problem for me turned out to be a duplicate GUID in one of the solution files. Inside the .sln for my installer I found that the Config project GUID (used all over the place) and the Installer project GUID (specific to the solution) were identitical. Opening the solution caused VS to change the GUID for one of them in the project file, though not apparently in the solution file. As it happens it always chose the shared one causing maximum grief. The fix was to create a new GUID for the installer project, and manually edit all the other solution files back to the correct GUID for the Config project.
I've no idea how this came about since I don't ever copy projects to create them.
I also see this problem in Visual Studio 2013, and it does not require Source Control integration to occur.
It happens to me occasionally when I have the same project in multiple solutions, each solution uses a different GUID for that project, and updates the project accordingly. The solution is to manually modify the .sln files to get them in sync. Credit for this answer goes to Chunsheng Tang.
First open the solution file (.sln) with notepad and check out the project references there. The format is like this:
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApplication1", "WindowsApplication1\WindowsApplication1.csproj", "{9378D255-CE38-45CD-82FA-A1EBFB86FD6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{DE374096-FF44-4FDF-B248-C767039B4175}"
EndProject
The second GUID for each project is the reference to the shared project.
To solve the problem, select a single GUID for your shared project; Make sure all the solutions that open it have that single thus the same GUID in their solution files. (Please backup your files before making these changes)
https://social.msdn.microsoft.com/Forums/en-US/1d632940-cc1d-49d5-a64c-d3e999216cbd/cant-avoid-the-projectguid-from-being-changed-in-csproj-file?forum=csharpide
The ProjectGuid changes because of integration with a source control system, like TFS. Happens if other people open the files for example.
There is workaround described here:
http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/1d632940-cc1d-49d5-a64c-d3e999216cbd
The solution file gets the project guid from the project file. Did you upgrade the solution/project from an earlier version of VS? If the guid in the solution file keeps changing, it could be because the project file doesn't have a guid at all, so VS makes up a new one each time the solution is opened. I'd call this a bug in the VS upgrade mechanism, but no one asked me. Fix the problem by adding a guid in your project file like this:
<PropertyGroup>
<ProjectGuid>{FB0F4A2A-1F78-42BF-8E31-E4FEFDC5565F}</ProjectGuid>
</PropertyGroup>
Open the solution one more time and let the project guid change one last time to this new guid. The guid will never change again.