Dec 8, 2017

C# generic function to export list of objects into excel file

C# generic function to export list of objects into excel file using EPPLUS library, if the file already contains the tab then data will be appended to the excel tab in worksheet.

Nov 8, 2017

Visual Studio 2017 Installer stuck at Applying Microsoft VisualStudio Debugger JustInTime

While installing Visual Studio 2017 Installer may stuck at Applying Microsoft VisualStudio Debugger JustInTime

if you are using older version of the installer. To solve the issue:
Solution 1
1. Click On Cancel, after few minutes it will ask to update VS installer.
2. Update the Visual Studio Installer. 
3. Restart your PC. Installer will auto-continue.

Solution 2
1. Download Process Explorer
2. Kill the process PowerShell.exe under vs_installershell.exe
3. Installer will resume skipping JustInTime
4. After VS installation completes you have to manually install JustInTime  


Package ‘Microsoft.VisualStudio.Debugger.JustInTime,version=15.0.26621.2’ failed to install


The solution was as simple as updating the System Variable __PSLockDownPolicy value to 1:
This is related to the PowerShell Constrained Language Mode, see the following article for more details:

Nov 9, 2016

Handling dynamically created RadioButtons in ASP.NET MVC




    @model ExampleViewModel
    @using (Html.BeginForm())
        <table class="table table-bordered table-striped">
            @for(int i=0;i<Model.Questions.Count;i++)
                var question = Model.Questions[i];

Aug 5, 2016

Marathi Keyboard v4.0 released on github

Virtual Keyboard Software to type in Devnagri script
Wrote C# code to map each key on keyboard with devanagari unicode font.

Source available on github:

  1. Type in marathi in any windows application easily using virtual keyboard software
  2. To switch between Marathi & Hindi language typing mode press "Ctrl+M"

Mar 16, 2015

C# Parse JSON into dynamic object

Parse JSON into dynamic object using Newtonsoft JSON library:
JsonReader jsonReader = new JsonTextReader(new StringReader(strText)) { DateParseHandling = DateParseHandling.None };
dynamic jsonObj = JObject.Load(jsonReader);

Mar 6, 2015

Electric Appliance Automation - An IoT Project using Windows Azure

I have started working on application Internet of things home automation using Windows Azure

In this article we’ll have look at controlling home appliances remotely over HTTP using a small API toolset we’ll create using ASP.NET web api. On top of that we’ll push the current device status to the client in real time with SignalR(windows service hosted)

We will Control following home appliances through windows service:
1. FAN - on/off, Speed adjust
2. Lights - on/off
3. Air Conditioner - on/off, Temperature Control
4. Speakers – on/off, Play/Pause/Stop song