Use Glimpse to debug ASP. net mvc applications

Source: Internet
Author: User

Original article address: NuGet Package of the Week #5-Debugging ASP. net mvc applications with GlimpseGlimpse is similar to the client debugger FireBug, which is implemented using JavaScript, but is also connected to the ASP. NET Server. Glimpse not only includes a better routing debugger, but also provides better support for Trace. Write (), which is very useful. Like in the actual series, you can start with me now and finish it within five minutes. Use NuGet to install Glimpse support for a new ASP. net mvc program or WinForm program. Before running the program, add Trace. Write and Trace. TraceError to the program.

 1 public ActionResult Index()
2 {
3 ViewBag.Message = "Welcome to ASP.NET MVC!";
4 Trace.Write("Hey, this is nice");
5 Trace.TraceWarning("Oh, this could be bad.");
6 return View();
7 }
8
9 public ActionResult About()
10 {
11 Trace.TraceError("Oh, no! Thats bad");
12 return View();
13 }
Now, run the program to open Glimpse through bookmarks. However, I like to access http: // localhost: portname/Glimpse/Config, and then click the Turn Glimpse On button to enable it, one day, I will add it to my bookmarks. Then, when visiting the site, we noticed that the control panel of Glimpse appeared at the bottom of the page. It was not a browser plug-in and was implemented in JavaScript. On the Trace tab, can Trace output be better than Trace. axd? If you switch to the Router tab, you can also see the route used by the current request. Glimpse, I will add it to my favorites to use it every day, and I suggest you do the same. I only know some of the usage on the surface. You can go to the Glimpse site for in-depth exploration: www.getglimpse.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.