Another application configuration setting you will observe in web.config of your ASP.NET MVC application is webpages:Version <add key="webpages:Version" value="3.0.0.0" /> The value for this setting currently is showing 3.0.0.0. This indicates the version of Webpages - Razor view engine is to be used. This application setting was introduced during update release of ASP.NET MVC 3 and is used to identify which Razor view engine to be used for handling webpages in your MVC application. Based on my digging into ASP.NET WebStack codebase on codeplex, Build and Revision component of version number are optional or can differ. If these two components of version number are not present or not found to be valid System.Web.WebPages.Deployment library fixes it to x.x.0.0 and returns the version number. What will » Read more
If you open your web.config at root of your MVC project you will find bunch of default appsetting keys added by MVC or WebAPI. One of the appsetting with key webpapges:Enabled is added which as default value as false. So what is the deal with this appsetting? To find out the answer to this simple question I started searching ASP.NET WebStack codebase on codeplex. This appsetting is processed by the System.Web.WebPages.Deployment - WebPagesDeployment.cs code. Dry-running the code base I got answer to my query. Three possibility for the appsetting - webpages:Enabled: Key - value not added at all or not having a valid boolean value. Key - value added and set to false. Key - value added and set to true. Case 1: In this case when PreApplicationStartCode > Start method is called which in turn calls > StartCore which internaly checks » 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