Project GUID keeps changing

后端 未结 6 1879
深忆病人
深忆病人 2021-01-07 16:24

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

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-07 17:17

    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

提交回复
热议问题