Most of you already know about it and rest are still confused and don't know what the hell is happening. This may help for the one who are still digesting the big changes and not sure what is going on! Story started long back (more than an year ago) and now have finally (I think) reached a much mature stage (comparatively). Big Name Change Starting with ASP.NET vNext (or vNext in general) with "K" set of tools. Then they renamed it to be called as ASP.NET 5 and finally settled with .NET Core 1.0 / ASP.NET Core 1.0. Scott wrote about it few months back and I recommend to take a read (really a short one - "Naming is hard."). Parallel Universe The .NET and Webstack continues the journey forward now in parallel. First: This one is "Windows Only" stack » Read more
While I was working on some code today and found that some NuGet packages where out of date. So I went to update tab in Manage NuGet packages window and updated all of them. MySql.Data package (not important which package, just an example) was also updated in that from version 6.7.8 to current / latest (6.9.6). I tried to run the application to test the updates made in referring packages. I encountered following error: TypeInitializationException was unhandled An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module. Additional information: The type initializer for '[Application Name]' threw an exception. Looking at this exception, it doesn't seems to be obvious what is going wrong here. There isn't even option for "View details". Many of you may get stuck on this and spent hours before you figure out that the AssemblyBinding.dependentAssembly.bindingRedirect are » Read more
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