Visual Studio不断更改project.sln文件
我在一个团队中从事Visual C ++项目.遵循建议,我们得到了用我们的SCM重新跟踪项目的.sln文件.事实证明,每次我从同伴那里拉来(是的,我们使用git)并在VS中打开解决方案时,都会更新.sln文件.正在更新的部分是在以下段中多次出现的long id(在这种情况下,以7C44结尾):
I work in a team on a Visual C++ project. Following advice we got we're tracking the project's .sln file with our SCM. It turns out that each time I pull from my partner (yes, we use git) and open the solution in VS, the .sln file is updated. The part being updated is the long id that appears several times (in this case ending with 7C44) in the following segment:
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Debug|Win32.ActiveCfg = Debug|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Debug|Win32.Build.0 = Debug|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.DebugStaticCRT|Win32.ActiveCfg = DebugStaticCRT|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.DebugStaticCRT|Win32.Build.0 = DebugStaticCRT|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Release|Win32.ActiveCfg = Release|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Release|Win32.Build.0 = Release|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.ReleaseStaticCRT|Win32.ActiveCfg = ReleaseStaticCRT|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.ReleaseStaticCRT|Win32.Build.0 = ReleaseStaticCRT|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Template|Win32.ActiveCfg = Template|Win32
{828CB89E-F092-3B7A-2F8C-62E146587C44}.Template|Win32.Build.0 = Template|Win32
这个数字是什么意思?我们如何才能使它在我们之间停止变化?
What does this number mean? How can we make it stop changing between us?
这是GUID,Visual Studio使用它来引用各个项目.在.sln文件顶部,您将在其中定义/导入项目的地方找到相同的GUID.
That is a GUID which Visual Studio uses to refer to the individual projects. You will find the same GUID at the top of the .sln file, where the projects are defined/imported.
Visual Studio从相应的.csproj/.vbproj文件读取GUID.在那里,您应该在顶部附近找到带有相应GUID的ProjectGuid属性.如果您和您的伙伴在此处定义了不同的GUID,则.sln也会更新.
Visual Studio reads the GUID from the corresponding .csproj/.vbproj file. There you should find a ProjectGuid property near the top with the corresponding GUID. If you and your partner have a different GUID defined there, the .sln will also update.