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

 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        

So someday you might need to create shortcut of or in your application programatically. Here is how you can do it: A shortcut is basically a LINK to the original file / executable that will be called when the link / shortcut is clicked. To create shortcut pro-grammatically, first you need add reference to Windows Script Host Object Model COM library in your project. Next add this using to your class - using IWshRuntimeLibrary; Next code snippet to create shortcut: var startupFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); var shell = new WshShell(); var shortCutLinkFilePath = Path.Combine(startupFolderPath, @"\CreateShortcutSample.lnk"); var windowsApplicationShortcut = (IWshShortcut)shell.CreateShortcut(shortCutLinkFilePath); windowsApplicationShortcut.Description = "How to create short for application example"; windowsApplicationShortcut.WorkingDirectory = Application.StartupPath; windowsApplicationShortcut.TargetPath = Application.ExecutablePath; windowsApplicationShortcut.Save(); Using above code, I create shortcut on my user's desktop. First line gives me the path to the desktop of my user - using Environment. » Read more

 Jsinh        

One thing a developer does all the time is debugging code, very obvious. At times the value of property or output of a method you are interested in might be deep inside a class. While debugging you would frequently add them to quick watch window or pin (bookmark) them to reach out quickly. One productivity tip is that you can use DebuggerDisplay on entities to make it quickly accessible while debugging. Let's take a simple class as example: namespace DebuggerDisplaySample { using System; using System.Diagnostics; using System.Globalization; public class Program { public static void Main(string[] args) { var programInstance = new Program(); programInstance.LastSavedDateTime = DateTime.ParseExact( "21-05-1985 12:12 PM", "dd-MM-yyyy hh:mm tt", CultureInfo.InvariantCulture, DateTimeStyles.None); Console.ReadLine(); } public DateTime LastSavedDateTime { get; set; } } } Here when you debug and hover on the programInstance or pin it (bookmark) it will show you the full name of the » Read more

 Jsinh        

I was recently working with a sidekick thing where I was using MySQL as my backend database. This was accessed from the application with hostname - localhost and username dev. I had created one view and was using it in the thing I was working on. It was originally scripted like this: CREATE DEFINER = 'dev'@'localhost' VIEW somedatabase.somerandomviewname AS SELECT `sd`.`somerandomcolumnone` as `ColOne`, `sd`.`somerandomcolumntwo` as `ColTwo` FROM `someshitytable` `sd` WHERE sd.blahblah IS NOT NULL; One day I realized that my workstation is going crazy over few tools I use everyday. I could have repaired or fixed or reinstalled them but then I choosed to do a full cleanup and start fresh (for no particular reason). So I used MySQL dump backup feature from maintanance and created backup scripts for that database, which also contains the creation script for this view obviously. Once my machine was ready » Read more

 Jsinh