Visual Studio 2017 在加载解决方案时挂起 [英] Visual Studio 2017 hangs while loading a solution

查看:44
本文介绍了Visual Studio 2017 在加载解决方案时挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 4 个项目的解决方案.

I have a solution containing 4 projects.

  • 一个 .NET Framework 项目(Ananas)
  • 两个 .NET Core 项目(香蕉和樱桃)
  • 一个 Xamarin 项目(Dewberries)

每次我启动 Visual Studio 2017 社区 (15.6.2) 并加载解决方案时,它在加载第一个项目 (Ananas) 时自行挂起.

Every time I start Visual Studio 2017 Community (15.6.2) and load the solution, it hangs itself while loading in the first project (Ananas).

我可以坐等它加载 30 分钟或更长时间,但进度条只会保持动画.我必须完全杀死 Visual Studio 才能阻止这种情况.

I can sit and wait for it to load for 30 minutes or more, but the progress bar will just keep animating. I have to totally kill Visual Studio to stop this.

如果我随后删除解决方案文件夹,并从我藏匿的备份存档中重新解压它并再次加载它,它会在第一次加载时不会挂起.但是当我关闭解决方案,关闭Visual Studio,重新启动并再次加载它时,它再次开始挂起.

If I then delete the solution folder, and unpack it anew from a backup archive that I have stashed away and load it up again, it loads the first time without hanging. But when I close the solution, close Visual Studio, restart and load it again, it starts to hang again.

推荐答案

如果您检查解决方案 (SLN) 文件,您可能会发现两个或多个项目的重复 GUID.请参阅下面的示例.

If you inspect the Solution (SLN) file, you may find duplicate GUIDs for two or more of the projects. See the example below.

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ananas", "Ananas\Ananas.csproj", "{F16C0F09-8509-4370-B4FF-C6E1C1C27C31}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bananas", "Bananas\Bananas.csproj", "{9D7771AE-8A04-438E-858A-7DBD42025BF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cherries", "Cherries\Cherries.csproj", "{91FB0CB7-5DC1-4B86-B33C-F22BE6A11CF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dewberries", "Dewberries\Dewberries.csproj", "{424ABA82-B745-4376-8A52-632B9016608E}"
EndProject

如您所见,第一个和最后一个项目具有相同的 GUID,中间的两个项目也具有相同的 GUID.您需要做的是生成一个有效的 GUID 来区分冲突的项目.这样,您会得到类似以下内容.

As you can see the first and the last project have the same GUID, and the two projects in the middle have the same GUID as well. What you need to do is generate a valid GUID to differentiate the conflicting projects. Such that, you get something like the following.

Project("{2CD1389C-9B3D-41E9-9AC4-FB6402671C81}") = "Ananas", "Ananas\Ananas.csproj", "{F16C0F09-8509-4370-B4FF-C6E1C1C27C31}"
EndProject
Project("{73ED998E-CD14-48E9-8193-A60F496F9CD7}") = "Bananas", "Bananas\Bananas.csproj", "{9D7771AE-8A04-438E-858A-7DBD42025BF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cherries", "Cherries\Cherries.csproj", "{91FB0CB7-5DC1-4B86-B33C-F22BE6A11CF2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dewberries", "Dewberries\Dewberries.csproj", "{424ABA82-B745-4376-8A52-632B9016608E}"
EndProject

要生成有效的 GUID,我建议您为此使用在线工具,例如 Online GUID Generator.

To generate valid GUIDs, I suggest that you use an online tool for this, such as Online GUID Generator.

这篇关于Visual Studio 2017 在加载解决方案时挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆