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 references). This was done some time ago.
Building straight from VS works fine.
Building from MSBUILD fails.
I have removed the project reference and re added it, and i've noticed that the project's GUID is changed. Building from MSBUILD now works.
Problem is, i now have to go over all projects and verify this.
Moreover, i have no idea why this occured (why is the project GUID different from what it was before, and not sure if this may happen again).
What could be the cause of this?
ProjectGuid is a unique identifier of a project within a solution. In SDK-based projects, the solution is the only thing that is aware of the project GUID - there was no need to duplicate it in the project.
If the sln is under source control first go to File | Source Control | Advanced | Change Source Control. Select the solution and click "Unbind". After saving the . sln to the new folder you can bind it again to source control.
If you want to know if it's a WCF Project or ASP.NET Web Service simply open your project's folders in File Explorer. You can hover over the icon with your mouse and a tooltip will display the project type as shown in the picture. Also, you can look under the Type column in File Explorer and it shows it there as well.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With