What are the project GUIDs in a Visual Studio solution file used for?

纵饮孤独 提交于 2019-11-30 02:39:39

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).

I will often copy a VS project file, rename it and search and replace all occurrences of the project name to create a new project with same settings. This is often quicker than creating a new project and then ensuring all the settings are correct. I ignore the GUID. VS will change the GUID as soon as I save the project after adding it to solution.

I do a lot of DLL/C/C++ development and I have deviated from the standard project settings extensively over the years (particularly in regard to optimization, code generation etc) and I find the copy technique a quicker, surer way of setting up a project.

The first guid is the project type. Project type guids can be found here...

http://www.codeproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs

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.

Word to the wise: If making an XBOX360 XNA 4.0 project and trying this trick, Don't use a guid generated by VS 2012. generate one in VS2010 and use that.

Or you will get the following error when you try to run your re-guid'ed project in XNA Game Studio Connect.

"This game is missing or corrupt, blah blah blah, restart XNA Game Studio Connect?"

and then it will bomb. VS 2010 guids work fine. I have no idea why.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!