There are so many productive tools and packages out there that can be used for profiling an ASP.NET MVC application. While back I wrote a quick intro about how Glimpse can come handy profiling your web application. There is one more simplistic and quick way to start profiling load / execution time for your application routines using MiniProfiler. This little package is prepared by folks at Stackexchange and used for Stackoverflow.com and other sites. MiniProfile's homepage shows quick way to get started with using MiniProfiler in your application. Following code snippet is required to profile a piece of code (not to forget MiniProfiler.Start() and MiniProfiler.Stop()): var profiler = MiniProfiler.Current; using (profiler.Step("Set page title")) { // Your code to profile } and you will see something similar to following when you load your application and run through profiled piece of code: {<1>} So if I » Read more
If you are not using Glimpse to debugging and profiling ASP.NET web application then you are missing out on very useful stuff I must say. This NuGet package brings many handy information about your ASP.NET MVC application, which in turn can be useful and quick help to dig state and performance issues in your application. Advantage of adapting Glimpse is that, it can be used in production environment where it can be enabled or visible based on your custom configuration / conditon. Thus gives you power to analyse your production state without compromising or hindering your environment rules and constraints. You can install Glimpse from NuGet into your ASP.NET MVC application with Install-Package Glimpse.Mvc5 (because I am using MVC5 for this example). This installs three packages: Glimpse.Mvc5 (Current release is 1.5.3) Glimpse.AspNet Glimpse (Core) If you are using other version of MVC you » Read more
When creating a MVC project using Visual Studio you will observe that creation process will add two web.config files to your project. In root of the project folder. In the root of the Views folder in the project folder. Question: The web.config in the root of the project is natural and expected, but why MVC project contains a web.config files in the views folder? Answer: To quote wikipedia: A controller can send commands to the model to update the model's state (e.g., editing a document). It can also send commands to its associated view to change the view's presentation of the model (e.g., by scrolling through a document). In ASP.NET MVC concept of routing is used that helps decoupling URLs mapping with specific files. Due to the routing definitions and route collection definitions of any application enables the application to serve a URL to » Read more
Started to learn MVC and WebAPI from scratch, have been working with non-web stuffs (mostly protocols and win-service) for a very long time and just want to get my head around with the Modern Microsoft way to do web stuffs using ASP.NET MVC and / or WebAPI. So I decided to add my learning notes here as Modern ASP.NET (MAN - slug) blog post series so it can help other starters to jingle and mingle with web using ASP.NET MVC and / or WebAPI. Current version of ASP.NET MVC is 5.1 and ASP.NET WebAPI is 2.1 So to answer my own question: What makes the base for any ASP.NET MVC, ASP.NET WebAPI web application and what code base it stands on? ASP.NET MVC 5.1 I created a new ASP.NET project from Visual studio (.NET 4.5.1) and used " » Read more