THE IDEA "God's Own Machine" - Always loved this term, not sure who coined it but read it first from Scott's Blog long back. All right - back in Early 2014, I decided to create my own build (custom assembled desktop computer) and I came up with a build that I call "Triga". Follow the link for more details of it. Three years later while using Triga day and night, I started feeling to do an upgrade and create a better build to keep up with the new tech / gadget's trend. Plus, this one was dying or lagging at times, especially when I try to work on Xamarin based stuffs. I believe that it is worth spending money as a programmer if you can save time and be more productive in your work instead of waiting for couple of seconds to few minutes to see your code building or project » Read more

 Jsinh        

Windows 10 says "Hello World" starting on 29th July, 2015. It is in the buzz since few months now and topping the charts everywhere on the release day and since then. I am sure most of you are now using brand new OS release from Microsoft - Windows 10. Reading this post on Microsoft Edge, newest browser that comes with Windows 10 release. All of us who decided to upgrade are excited about the new and better start menu, no more full screen store apps and redesigned control panel. Not to forget explorer and command prompt. Once you are on Windows 10 and decide to stay with it and not roll-back, one thing I recommend you should is claim your free space back. While you were upgrading or did a manual upgrade to Windows 10, the upgrade process should have created few hidden folders in your System drive (volume where » Read more

 Jsinh        

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 creating this » Read more

 Jsinh        

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.PageViews_ViewStartcshtml' 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.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web. » Read more

 Jsinh        

Pretty exciting times for all developers. Microsoft is changing the course on how you can build application and not worry what platform you choose to achieve that. Every few months and at sessions / conference we see Microsoft teams making Frameworks, Libraries and Tools open source. As "No one is left behind, we are hearing you" is in the air you breath. .NET development / execution stack is reaching OS X and Linux. This love is growing more and more every day. In past we saw few eye catching deals like ASP.NET 5 / MVC 6 and "Develop using your favorite editor" - OmniSharp, today at Microsoft Build 2015 developer conference Visual Studio Code Editor was announced. One more edition of Visual Studio in the belt. This one is particular and different from the regular Visual Studio IDE that you use. It is Microsoft's offering that can be used to develop application » Read more

 Jsinh        

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

 Jsinh        

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 ASP.NET 5 removed the web.config XML based configuration files and bring JSON based project.json and other similar files to maintain configuration related to your application. project.json is the main file that contains meta-information / configuration for running your ASP.NET 5 application. This JSON file consist of a node named compilationOptions which defines a child called languageVersion. Currently ASP.NET 5 only supports C# language. languageVersion can be one of the following options: It provides way to choose which » Read more

 Jsinh        

Apple MacOS has beautiful rounded corner scrollbar and add to the UI experience you have while working on a MacOS machine. You can easily have similar scrollbar style for your WPF application to boost up your application's UI experience. If you wish to apply this scrollbar style application wide then you should follow below steps. Step: Create a new resource dictionary (skip creating if you already have one) file and add the following code to it. <Style x:Key="ScrollBarTrackThumb" TargetType="{x:Type Thumb}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Thumb}"> <Grid x:Name="Grid"> <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent" /> <Border x:Name="CornerScrollBarRectangle" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Margin="0,1,0,1" Background="{TemplateBinding Background}" /> </Grid> <ControlTemplate. » Read more

 Jsinh        

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: So if I need to profile the execution » Read more

 Jsinh        

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

 Jsinh        

Microsoft and Visual Studio team announced release of Community Technology Preview 5 (CTP 5). Download: Visual Studio 2015 CTP5 This version of visual studio brings lots of improvements / better integration and bug fixes for ASP.NET (ASP.NET 5 vNext version). Some of the highlighted features, changes and fixes released with this version of Visual studio: XAML langauge service rebuilt on top of .NET Compiler Platfor ("Roslyn"), fast and reliable XAML editing experience with intellisense. Timeline tool - New UI Performance Analysis Tool for WPF Applications Improvements to IntelliTrace in Visual Studio Ultimate 2015 Improvements to Diagnostic tools debugger window Announcing TypeScript 1.4 Tons of improvements and bug fixes for ASP.NET 5 - Beta 2 This is a good oppurtunity to try out the new features that will be part of Visual Studio 2015 (the name might change). » Read more

 Jsinh        

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 Web" » Read more

 Jsinh        

Not blogging yet? Around 1.5 years back, I wrote a post about what i call Slumdog Blogging, and I think you should read it. I learned a few things during my blogging journey and reading around which I would like to share today. Choose your seat and stick to it. I started blogging in late 2011 on URL: jsinh.in. At the time of starting I never thought of other things I might like to do with the domain. In few years I decided to put out a page or two where I can meta-link to well-known sites where I can be found. This was with the intention to give "More information" links to people who are interested in what I do or I don't. This would be about me and more direct, blogging content and articles is about what I write or wrote and shared with the community. » Read more

 Jsinh        

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

 Jsinh        

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

 Jsinh        

When you design your table, you choose to add a primary key constraint for one or more column while create the same. Column attached with primary key constraint should contain UNIQUE and NOT NULL values. We all know that. But PostgreSQL does not force this constraint while creating a new table, you might forget to add one (missing morning coffee may be). I tried creating a table without adding primary key constraint in PostgreSQL CREATE TABLE weather ( city character varying(80), temp_lo integer, temp_hi integer, prcp real, date date ); This took off and created the weather table successfully. Now when I tried to view data (which I inserted after creating the table) using pgAdmin III, it displayed hint (warning, I would say) as Edit table data without primary key This warning message say, I will not be able to edit or change existing row data since I do » Read more

 Jsinh