Visual Studio 2015中的历史调试,性能分析,新诊断工具

Visual Studio 2015中的历史调试,性能分析,新诊断工具

I've been working with Visual Studio 2015 lately, even for older projects. You can create and edit all kids of .NET app from .NET 2.0 all the way up through .NET 4.6, as well as ASP.NET 5 apps on the Core CLR.

我最近一直在使用Visual Studio 2015,即使是较旧的项目也是如此。 您可以从.NET 2.0一直到.NET 4.6以及在Core CLR上的ASP.NET 5应用程序中创建和编辑.NET应用程序的所有子级。

In my case I've been doing some pair programming with Mark Downie on DasBlog, the blog system that runs this blog right here. DasBlog is very old, and used to be very actively developed. The question "is DasBlog dead" is asked a lot, but the answer is really "DasBlog is done." For years it has been very feature-full and feature-complete. However, this blog has been running on .NET 2.0 for years. Mark and I thought it would be nice to upgrade DasBlog to .NET 4.6, so we did. We've also moved DasBlog over to GitHub. You'll find it at http://github.com/shanselman/dasblog.

就我而言,我一直在DasBlog上与Mark Downie进行一些配对编程,该系统在此处运行此博客。 DasBlog很老,并且过去非常活跃。 人们经常问“ DasBlog已死”这个问题,但答案确实是“ DasBlog已完成”。 多年来,它一直是非常完整的功能和完整的功能。 但是,此博客已在.NET 2.0上运行多年。 Mark和我认为将DasBlog升级到.NET 4.6很好,所以我们做到了。 我们还将DasBlog移至GitHub。 您可以在http://github.com/shanselman/dasblog中找到它。

Now, to be clear, DasBlog was amazing in 2004 and 2008 but it's aging now. Mark and I think that's the fun of it, though. Mark's added Twitter Card and Facebook Open Graph support, and together we've fixed a few oddities and bugs that have popped up in the leap from 2.0 to 4.6. However DasBlog remains idiomatic .NET 2.0 which means it's C# 2.0, and doesn't even make good use of Linq or generics. We're thinking about a few updates, moving the Templating system to RazorEngine, updating to Linq queries, smarter threading for collections, better caching, as well of Mark's ideas around social.

现在,很明显,DasBlog在2004年和2008年令人惊叹,但现在已经过时了。 马克和我认为这很有趣。 马克(Mark)添加了Twitter Card和Facebook Open Graph支持,并且我们共同修复了从2.0到4.6飞跃的怪异和错误。 但是,DasBlog仍然是惯用的.NET 2.0 ,这意味着它是C#2.0,甚至没有很好地使用Linq或泛型。 我们正在考虑一些更新,将模板系统迁移到RazorEngine ,更新到Linq查询,更智能的集合线程,更好的缓存,以及Mark关于社交的想法。

You might think it's weird to use Visual Studio 2015 to work with a .NET 2.0 app, but it's useful to remember that you get to use new Visual Studio features even with older frameworks. One of the most useful new features is the Diagnostic Tools toolbox. It's a boring name for an amazing new part of VS. I'm not sure what they could call it other than Diagnostic Tools, but it's insanely convenient.

您可能认为使用Visual Studio 2015与.NET 2.0应用程序配合使用很奇怪,但是记住即使在较旧的框架中也要使用新的Visual Studio功能,这很有用。 最有用的新功能之一是诊断工具工具箱。 这是VS令人惊叹的新部分的无聊名称。 除了诊断工具外,我不确定他们还能称呼什么,但这非常方便。

Visual Studio 2015中的历史调试,性能分析,新诊断工具

Often we think of Debugging and Profiling as two separate activities, and honestly, I talk to developers all the time that have never Profiled an app. They know that Profiling exists as a tool and a concept, but for whatever reason they forget about it, don't get around to it, or haven't adopted it as a fundamental part of their daily workflow.

通常,我们将调试和概要分析视为两个独立的活动,老实说,我一直在与从未分析过应用程序的开发人员进行交谈。 他们知道配置文件作为工具和概念存在,但是出于任何原因,他们忘记了它,不去了解它或没有将其作为日常工作流程的基本部分。

The Diagnostic Tools in Visual Studio 2015 bring in data from a number of sources, Breakpoints, the Debugger, Tracing and Debug out, as well as Intellitrace Events and Historical Debugging (on supported SKUs).

Visual Studio 2015中的诊断工具从许多来源(断点,调试器,跟踪和调试出)以及Intellitrace事件和历史调试(在受支持的SKU上)引入数据。

Notice in the screenshot above, I can even see a little tip showing how many milliseconds has elapsed between two breakpoints. It's little features like this that take data that has long been available but not in front of your face. Why dig for it?

请注意,在上面的屏幕截图中,我什至可以看到一个提示,显示两个断点之间经过了多少毫秒。 像这样的小功能可以获取早已可用但不在您面前的数据。 为什么要挖呢?

Visual Studio 2015中的历史调试,性能分析,新诊断工具

I can even go back in time with Historical Debugging. See how I can backup and see the state of Local Variables and the Call Stack when I'm at a Breakpoint?

我什至可以回溯历史调试。 看看在断点时如何备份并查看局部变量和调用堆栈的状态?

Visual Studio 2015中的历史调试,性能分析,新诊断工具

If you have a SKU with IntelliTrace, you can get extra info if you'd like to enable Historical Debugging.

如果您具有IntelliTrace的SKU,则想启用历史记录调试,就可以获得更多信息。

Visual Studio 2015中的历史调试,性能分析,新诊断工具

See how I've got Memory and CPU graphs, and I didn't have to do anything? This pops up automatically when Debugging:

看看我如何获得“内存”和“ CPU”图,而我无需执行任何操作? 调试时会自动弹出:

Visual Studio 2015中的历史调试,性能分析,新诊断工具

I can take Memory Snapshots, go to the next Breakpoint, take another and compare!

我可以拍摄内存快照,转到下一个断点,再拍摄另一个并进行比较!

Visual Studio 2015中的历史调试,性能分析,新诊断工具

If you've got Visual Studio 2015 and haven't started using these tools, I'd suggest you start exploring. They're useful enough that they've got me using VS2015 RC for all my projects, even older .NET 2.0 ones.

如果您拥有Visual Studio 2015,但尚未开始使用这些工具,建议您开始探索。 它们足够有用,以至于让我在我的所有项目中使用VS2015 RC,甚至是较旧的.NET 2.0项目。

NOTE: Remember that Visual Studio Community is free for Open Source projects, and supports extensions! http://www.visualstudio.com/free

注意:请记住,Visual Studio社区对于开源项目是免费的,并且支持扩展! http://www.visualstudio.com/free

关于斯科特 (About Scott)

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。

Visual Studio 2015中的历史调试,性能分析,新诊断工具
Visual Studio 2015中的历史调试,性能分析,新诊断工具
Visual Studio 2015中的历史调试,性能分析,新诊断工具
About   关于 Newsletter 时事通讯
Hosting By 主持人
Visual Studio 2015中的历史调试,性能分析,新诊断工具

翻译自: https://www.hanselman.com/blog/historical-debugging-profiling-new-diagnostic-tools-in-visual-studio-2015