views:

245

answers:

2

I have multiple projects in a single Visual Studio (2008) solution.
I just discovered that each of these projects uses a same GUID, so in the solution file it looks like this:

Project("{FAE04EC0-F103-D311-BF4B-00C04FCBFE97}") = "Pro1", "Pro1\Pro1.csproj", "{...}"
Project("{FAE04EC0-F103-D311-BF4B-00C04FCBFE97}") = "Pro2", "Pro2\Pro2.csproj", "{...}"

Do I have to change these GUIDs so they're unique and what are they used for?

A: 

The project guids in the csproj file should be unique. From my experience if two csproj files are included in the same solution visual studio automatically regenerates one of the guids.

Ryu
+4  A: 

Project persistence block in a solution file has the following format:

Project("{project type GUID}") = "<Project name>", "<project file location>", 
    "{<Unique project GUID>}"
EndProject

So it's expected that first GUID is non-unique, it uniquely identifies Visual Studio package that handles this type of projects.

The GUID you posted is interesting - it looks like mangled C# project GUID, which is FAE04EC0-301F-11D3-BF4B-00C04F79EFBC. Did you change it yourself or is it a posting issue (e.g. you are using right-to-left locale such as Hebrew or Arabic).

Oleg Tkachenko
Thanks a lot Oleg! I changed the GUID myself because I thought it would be unique per solution or so. I didn't have any better idea than reversing some of its values and certainly didn't think that it would be a common value for C# projects :-)
Marc