Using MySQL community server in one of the projects I have been working on. Few days back I reset my machine and installed latest version of MySQL server - v5.7.12 (development mode). This started giving me error on "update from source" in EntityFramework (EDMX) - design first approach. Unexpected exception occurred when generating the model. See output window for more details. Exception message : 'StrongTypingException: The value for column 'IsPrimaryKey' in table 'TableDetails' is DBNull.'. So I started googling (obviously) and came across few bugs already reported with similar problem - here and here. I was able to solve the issue in most simplest way possible is to downgrade to MySQL Server Version 5.6.30 There might be other ways to fix it with latest version of MySQL server but this was the straight forward fix I can use to get around this issue and IT WORKED. » Read more

 Jsinh        

Azure notification hub can be used to send push notification to your client app. It supports sending push notification to application build with Xamarin (but not only restricted to it). I create a notification hub in Azure using FREE TIER for a work related project, with intention to be used by team to work and test push notification in their application development. Development environment setup gave assumption that the usage will be quite less so free tier will suffice the need here. When you install the application (the one which has integrated Azure Notification Hub) on first run application will register the device with the Azure notification hub service (based on permission available) and that will count against "Active Device" in your hub server statistics. Last night, team member complained that he is now getting: 'The remote server returned an error: (403) Forbidden.'.', Exception=System.Net.WebException: The » Read more

 Jsinh        

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 which currently includes .NET 4.6 » Read more

 Jsinh        

To start using Couchbase solution as data store for your mobile application you need to setup up couple of things. This stack is named Couchbase Mobile and consist of three components: Couchbase Lite (Embedded NoSQL database) Couchbase Sync Gateway (Server component to synchronize data between the device and server) Couchbase Server (NoSQL database server) Download the above components from here. Going forward we are going to setup the two server components from the above list on Ubuntu machine (Ubuntu 14.04 at the time of writing). For the sake of writing, I have used droplet from Digital Ocean. But it is not restricted to any hosting provider. You can spin up a Ubuntu machine on Amazon Web Service, Microsoft Azure or any other hosting provider of your choice. AWS also provides a ready made package for the same in AWS marketplace you can use. Once you have a Ubuntu machine » Read more

 Jsinh        

Quick note: Below case only affects developers using VS2015 (only) and AzureSDK for .NET - v2.8.2 seems to fix the problem. Link: Azure SDK for .NET v2.8.2 Many of you are using Azure Mobile Service as your service back-end for the mobile device applications. It has been there for a while now and it is pretty awesome. Azure and Microsoft recently shifting towards the concepts of App Mobile Service resource to do the Mobile Service stuffs with the same pattern that applies to ASP.NET MVC and WebAPI. Flash back For everyone who has a hosted Azure Mobile Service in their Azure Account should be seeing this new option called "Migrate to App Service" when that resource is selected in Classic Azure Portal: This is an in-place upgrade to the App Service provided by Azure team. When you click on that option you see details of » 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: <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken= » Read more

 Jsinh        

Small footprint Windows Server Images is not a myth anymore. Few weeks back Microsoft announced the availability of Windows Nano Server preview coming out as part of Windows Server 2016 Technical Preview 2. Nano Server as they call at the moment is a re-engineered, small footprint, hosting oriented, command-line only, minimal install option for Windows Server specifically designed for hosting applications, services and routines in cloud and data-centers. This one is specifically small in size and has only minimal required things to start with. I will walk you through setting up and installing Windows Nano Server in VM on Hyper-V Note: This guide is tested, works and applies to Windows Server 2016 Technical Preview 2 To obtain source image for Windows Nano Server you need to download latest build for Windows Server 2016 (current version is Technical Preview 2) Windows Nano Server image *.wim can be found in a folder » 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        

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 change from the way it is, following summary is based on what he narrates (and what I understand): New configuration subsystem... Should be light-weight. Should run everywhere, Cloud Optimized / Enabled. Can work without using lots of #ifdef (common base for platform profile(s) it can support). Application's responsibility to instantiate Configuration sub-system as they do for other subsystem like MVC, Identity or Razor etc. This also means you can have more » Read more

 Jsinh        

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 version of C# you wish to use for your application to compile against. I selected csharp2 from the option intellisense list, added an AutoProperty and Task to my code. Visual studio immediately starts giving red swiglies similar to following: This change will also give error on Linux or MacOS X system when compiled: I also see almost similar language version option in older version of ASP.NET and » 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