Recently, when debugging NopCommerce, we often encounter an address that does not know which route to request (for example, http: // localhost/apparel-shoes, such as http: // localhost/login) can you quickly tell which controller and which action is used? Of course, you can search and view it in the background, but now you have a tool that you can add to the page to display routing and other information on the current page. This is our topic MiniProfiler today, let's begin!
1. Introduction to MVC MiniProfiler
MVC MiniProfiler is a small program designed by the Stack Overflow team to analyze the performance of ASP. net mvc, WebForm, and WCF. You can monitor a page and other pages accessed through direct reference, Ajax, and Iframe. The monitoring content includes the database content, the SQL statements used to access the database (EF and EF CodeFirst are supported) are displayed ). And displayed on the page in a friendly way.
My summary is that you can view the MVC routing and analyze the page execution time.
2. Enable MiniProfiler debugging in NopCommerce
1st modification: in global. asax, this parameter will be used to directly start debugging for local localhost access)
Change
2nd modification: in global. asax, the local localhost access will be directly disabled for debugging)
Modify at 3rd: In _ Root. Head. cshtml
Add Request. Islocal
3. Test Results
We can easily see the route information and execution time, as well as more functional options. Let's take a look! Let's get there today!