I have a C++ solution (solution.sln) where I want to include an existing library (library.vcproj), so I open solution.sln in Visual Studio and include the library.vcproj file for it. Then I set up the project dependencies and some include paths to get it to compile. Everything works fine.
When I’m about to commit these changes into the repository (svn) I notice the library.vcproj has changed. I check differences and it’s just the GUID for the project that has changed. I take a look at solution.sln differences and find out that, as I expected, the new project GUID is in use to identify library.vcproj.
I’ve done this a gazillion times, and I never saw this behaviour before.
As a workaround to avoid library.vcproj file modification, I revert the changes to it and manually edit the solution.sln replacing the project’s new GUID for the former one.
When opening solution.sln back in Visual Studio, everything works fine, but a new GUID is created replacing the libray project’s in both the solution.sln and library.vcproj.
library.vcproj is included in several other solutions, so just committing the change would affect several other files.
What could be causing such a behavior? Is the GUID or a project reference stored anywhere else?
I’m using Visual Studio 2005.
I found the reason for this behavior. It’s not a VS bug, it’s actually a robust behavior!
There is another library includd into
solution.slnwith the same GUID so VS updates the GUID of the incominglibrary.vcproj.Digging into svn logs I could find that someone copied the
library.vcprojfile from anther library and edited just the library name. Both libraries share most of the build configuration data and other stuff into the.vcprojfile, but forgot to change the GUID value.I’m ashamed to sa it but… that someone turned out to be me.
Thanks for your comments and time to consider the question.