Did you encountered following exception / error when trying to run ASP.NET MVC web application? The view must derive from WebViewPage, or WebViewPage or Type 'ASP._Page_Views__ViewStart_cshtml' does not inherit from 'System.Web.WebPages.StartPage'. I encountered while I was playing with MVC 5 (applies to MVC 3 and 4 also) application. Every razor page should inherit from System.Web.Mvc.WebViewPage. You can resolve this issue by adding following line at the top in each view razor (*.cshtml) page: @inherits System.Web.Mvc.WebViewPage and add following line at the top of _ViewStart.cshtml : @inherits System.Web.Mvc.ViewStartPage or you can add a web.config file and add following (in root of Views folder where the Razor pages reside) <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.webPages.razor" type="System. » Read more
Note: [Deprecated Content] This was written while ASP.NET and .NET Core was in beta (around beta5 or beta6). Since then a lot of stuffs have changed and moved around. Stuffs described below may or may not be true for current stable releases of ASP.NET Core - Configuration feature. I recommend not to follow along and get confused. Use official configuration documentation that explains it correctly - docs.asp.net With the upcoming release of .NET 4.6 and ASP.NET 5 (currently in BETA phase) one namespace that is getting new look (re-written) is System.Configuration. If you have not already read then I recommend you to take a look at getting started post by Louis DeJardin - ASP.NET vNext Moving Parts: IConfiguration He has also explained other moving parts which are some interesting reads. Why you ask? Louis explains few reason why System.Configuration needs to » Read more
The brand new version ASP.NET 5 (a.k.a ASP.NET vNext) can be developed and hosted on all three major platform - Windows, Linux and MacOS. Getting started with ASP.NET 5 (TODO: Link to be updated with new Post for .NET tools) is not so hard after all and is definitely fun to play early. The biggest break through that comes to .NET and ASP.NET world is the capability to write and host anywhere. Yes you can now develop and host a ASP.NET Web application - MVC or WebAPI even SignalR on any platform - Windows, Linux and MacOS. This has always been the de-facto standard for windows since long using Visual Studio (prior VS2015) but it can be fun on Linux and MacOS also using your favourite editors or Visual Studio Code. Following step needs to be performed on a brand new spinning Linux » Read more
Note: [Deprecated Content] This was written while ASP.NET and .NET Core was in beta (around beta5 or beta6). Since then a lot of stuffs have changed and moved around. Stuffs described below may or may not be true for current stable releases of ASP.NET Core. I recommend not to follow along and get confused. Use official configuration documentation that explains it correctly - docs.asp.net Along with the new version ASP.NET 5, comes some small goodies that are worth taking look at. One of those tiny but powerful enhancment currently experimented in ASP.NET 5 (still in BETA at the time of writing, may change) is the way to control exception / error detail displayed to end user and showing full stack trace and additional information when the developer is working. If you have given a try to the default template - "ASP.NET 5 Starter » 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