mvc如何应用nuget包_第五周NuGet软件包-使用Glimpse调试ASP.NET MVC应用程序

mvc如何应用nuget包

mvc如何应用nuget包

Hey, have you implemented the NuGet Action Plan? Get on it, it'll take only 5 minutes: NuGet Action Plan - Upgrade to 1.2, Setup Automatic Updates, Get NuGet Package Explorer. NuGet 1.2 is out, so make sure you're set to automatically update!

嘿,您是否执行了NuGet行动计划 上车,仅需5分钟: NuGet行动计划-升级到1.2,设置自动更新,获取NuGet软件包资源管理器 NuGet 1.2已发布,因此请确保您设置为自动更新!

The Backstory: I was thinking since the NuGet .NET package management site is starting to fill up that I should start looking for gems (no pun intended) in there. You know, really useful stuff that folks might otherwise not find. I'll look for mostly open source projects, ones I think are really useful. I'll look at how they built their NuGet packages, if there's anything interesting about the way the designed the out of the box experience (and anything they could do to make it better) as well as what the package itself does.

背景:自从NuGet .NET程序包管理站点开始填充以来,我一直在思考,我应该开始在其中查找gem(无双关语)。 您知道的,否则人们可能找不到真正有用的东西。 我会寻找大多数开源项目,这些项目我认为真的很有用。 我将看看他们如何构建他们的NuGet软件包,如果关于开箱即用体验的设计方式(以及他们可以做得更好的任何方式)以及软件包本身的功能有什么有趣的事情。

客户端窥探您的服务器 (A Client Side Glimpse into your Server)

Glimpse is like the FireBug client side debugger, except it's implemented in JavaScript on the client side with hooks in to ASP.NET on the Server Side.

Glimpse类似于FireBug客户端调试器,只是它在客户端JavaScript中实现,并与服务器端的ASP.NET挂钩。

Glimpse includes not only better Route Debugging support than Phil Haack's original Route Debugger, but also excellent support for the little used but totally useful Trace.Write().

Glimpse不仅提供了比Phil Haack最初的Route Debugger更好的Route Debugging支持,而且还为很少使用但完全有用的Trace.Write()提供了出色的支持。

Let's just see it in action. You can do this with me now, in less than 5 minutes.

让我们看看它的实际效果。 您现在可以在不到5分钟的时间内与我联系。

From a new ASP.NET MVC application (Or WebForms, for that matter), install Glimpse.

从新的ASP.NET MVC应用程序(或者WebForms)中,安装Glimpse。

Before I run my app, I'm going to sprinkle in some Trace.Write and Trace.TraceError just to make the point.

在运行我的应用程序之前,我将先添加一些Trace.Write和Trace.TraceError来说明这一点。

public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
Trace.Write("Hey, this is nice");
Trace.TraceWarning("Oh, this could be bad.");
return View();
}

public ActionResult About()
{
Trace.TraceError("Oh, no! That's bad");
return View();
}

Now, I'll run my app. I can turn Glimpse on with a Bookmarklet, but I like visiting http://localhost:portname/Glimpse/Config and pressing the big "Turn Glimpse On" button. I'll drag the bookmarklet onto my toolbar one day.

现在,我将运行我的应用程序。 我可以使用书签打开Glimpse,但是我喜欢访问http:// localhost:portname / Glimpse / Config并按大的“ Turn Glimpse On”按钮。 有一天,我将小书签拖到工具栏上。

Next, when I visit my site, notice the Glimpse control panel at the bottom! Insane. It's NOT a browser plugin, Dear Reader, that's all JavaScript.

接下来,当我访问我的网站时,请注意底部的Glimpse控制面板! 疯。 亲爱的读者,这不是浏览器插件,而是全部JavaScript。

*Mind blown* see my Server-side Trace information in the Trace tab?  Isn't that nicer than Trace.axd?

*烦死*在“跟踪”选项卡中看到我的服务器端跟踪信息? 那不是Trace.axd好吗?

If I switch to the Routes tab, I can see which Route matched my /Home/About request.

如果我切换到“路线”标签,则可以看到哪个路线与/ Home / About请求相匹配。

Here's the Execution tab of Glimpse. I can see the methods that were executed, including those that weren't. Insane.

这是“瞥见”的“执行”选项卡。 我可以看到已执行的方法,包括未执行的方法。 疯。

Glimpse, along with ELMAH,  is officially my favorite add-on to ASP.NET MVC. I'll be using it every day and I recommend you do as well.

Glimpse和ELMAH一起是我最喜欢的ASP.NET MVC插件。 我每天都会使用它,建议您也这样做。

I'm only touching the surface of what Glimpse can do, but I'll leave that extended tour their great site at http://www.getglimpse.com.

我只是在摸索Glimpse可以做的事情的表面,但是我将继续浏览他们在http://www.getglimpse.com上的出色站点。

Enjoy.

请享用。

翻译自: https://www.hanselman.com/blog/nuget-package-of-the-week-5-debugging-aspnet-mvc-applications-with-glimpse

mvc如何应用nuget包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值