【发布时间】:2014-07-09 14:48:23
【问题描述】:
我最近为一个新项目从 VS 2010 升级到 VS 2013。我发现在我的 Web 应用程序项目中右键单击文件夹(而不是单个文件)时,加载上下文菜单大约需要 2 秒。解决方案中的其他十几个非 Web 项目没有这个性能问题。此外,在那个缓慢的上下文菜单中,如果我单击“添加”-> 项目以调出子菜单以添加新的视图/类/任何内容,则该菜单需要 5-10 秒才能出现。如果我认为从那里选择“新脚手架项目”之类的内容,则该对话框可能需要大约 30 秒才能出现。
我项目中的其他人似乎没有遇到这个问题,尽管他们的硬件稍好一些,并且运行的是 Windows 8(而我运行的是 Windows 7)。我试过禁用here 描述的视觉体验元素,但它似乎没有效果。我的系统似乎只使用了 8GB 可用 RAM 中的大约 5GB,而我的 CPU 使用率从未超过 30%。我已尝试禁用 ReSharper,以防万一导致速度变慢,但它对性能没有影响。
如何解决这个巨大的减速问题?
Microsoft Visual Studio Premium 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Premium
LightSwitch for Visual Studio 2013 06191-004-0454001-02932
Microsoft LightSwitch for Visual Studio 2013
Office Developer Tools - May 2014 Update ENU 06191-004-0454001-02932
Microsoft Office Developer Tools for Visual Studio 2013 - May 2014 Update ENU
Team Explorer for Visual Studio 2013 06191-004-0454001-02932
Microsoft Team Explorer for Visual Studio 2013
Visual Basic 2013 06191-004-0454001-02932
Microsoft Visual Basic 2013
Visual C# 2013 06191-004-0454001-02932
Microsoft Visual C# 2013
Visual C++ 2013 06191-004-0454001-02932
Microsoft Visual C++ 2013
Visual F# 2013 06191-004-0454001-02932
Microsoft Visual F# 2013
Visual Studio 2013 Code Analysis Spell Checker 06191-004-0454001-02932
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker
Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.
The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.
ASP.NET and Web Tools 2013.2.50425
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure
ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563
ASP.NET Web Frameworks and Tools 2013 5.1.20409.0
For additional information, visit http://www.asp.net/
Common Azure Tools 1.1
Provides common services for use by Azure Mobile Services and Windows Azure Tools.
JetBrains ReSharper 8.2.1 C# Edition build 8.2.1000.4556 on 2014-05-19T16:12:38
JetBrains ReSharper 8.2.1 package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper/. Copyright © 2003–2014 JetBrains, Inc.
NuGet Package Manager 2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
SQL Server Data Tools 12.0.30919.1
Microsoft SQL Server Data Tools
TechTalk SpecFlow 1.9.3
TechTalk SpecFlow - Binding business requirements to .NET code, http://www.specflow.org
Copyright © 2009–2013 TechTalk
Windows Azure Mobile Services Tools 1.1
Windows Azure Mobile Services Tools
Windows Azure Tools 2.3
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602
Windows Phone 8.1 SDK Integration 1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.
Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.
更新:为了解决这个问题,我彻底擦除了我的硬盘并更新到 Windows 8。我还升级到了 16GB 的 RAM。然后我安装了足够的软件,以便我可以编译项目。我仍然遇到同样的减速。但是,如果我创建一个全新的 Web 应用程序,上下文菜单会很快。项目本身的某些事情会导致放缓吗?
【问题讨论】:
-
我也遇到了同样的问题...延迟 30 秒才能在 Web 项目上显示上下文菜单!你有没有弄清楚是什么原因造成的?
-
不幸的是,没有。而且那个项目现在已经结束了,所以如果真的有答案,我可能无法测试答案。我想知道 VS 2015 是否会遇到同样的问题。
-
@AlexEdelstein 安装 Windows SDK/Windows Performace Toolkit (msdn.microsoft.com/en-US/windows/desktop/bg162891),运行 WPRUI.exe,选择 CPU、磁盘、FileIO、VirtualAlloc、ResidentSet、XAML 并按开始。现在执行慢速 VS 操作,返回 WPRUI 并在 Save 上计时并将其存储到 ETL 文件中。将 ETl 文件 + NGENPDB 文件夹压缩为 zip,上传 zip 并在此处发布链接。
-
感谢您的建议。我们目前无法重现我们一直看到的 30 秒延迟。运行 WPRUI 似乎涉及相当多的手术,包括禁用寻呼执行器,这是我们不满意的东西,所以我们暂时搁置这个建议。
-
文件夹中是否有大量文件可能不包含在项目中?不久前我经历过类似的事情,我怀疑这是因为 Visual Studio 或其中一个扩展正在扫描项目文件夹,但它在我的节点模块和凉亭组件中有大量文件。这可能是试图扫描文件夹,或者可能是源代码控制执行类似的操作(git、TFS),即使设置为忽略这些包。现在,您可以选择试用 Visual Studio 2015!试试看是否还有问题。