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
Please note: [Deprecated Content] This article is outdated now and lot of things have changed since it was written. Please refer / read to the newer version of the related article instead of the content below. Also follow along and learn about the latest bits on official ASP.NET Core documentation Thanks! In case you missed the big news, then its time to say 'Hey to K (KAY)' (i just made it up). Recently Microsoft announced .NET as Open Source with .NET 2015, ASP.NET 5 (vNext), ASP.NET Web Development on MAC and LINUX platform and the biggest of all Visual Studio IDE Community SKU (Visual Studio for Everyone - FREE). Leaving behind the closed group development practices and proprietary line of products, Microsoft is finally taking big step to embrace the open source way and community driven development. I feel very excited to see this happening already and » Read more