Category Archives: .NET

Adding Support of .NET Framework 4.6.1 Prerequisite into InstallShield 2015 in VS2015

For most of .NET developers, you might need to create a installer package for your developed application and you might be using InstallShield. One of the configuration that you would do is setting up the .NET Framework requirement for your project.

In VS2015 with InstallShield 2015, you will found the pre-defined package for the requirement of .NET framework is only up to “Microsoft .NET Framework 4.5 Full package”. I am going to show you how to add the package into InstallShield 2015 for the “Microsoft .NET Framework 4.6.1 Full Package”.

Below is the text that can be used to create your own .prq file for the Microsoft .NET Framework 4.6.1 Full Prerequisite.
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
< SetupPrereq>
<condition Type=”2″ Comparison=”2″ Path=”HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full” FileName=”Release” ReturnValue=”394254″/>
<operatingsystemcondition MajorVersion=”6″ MinorVersion=”1″ PlatformId=”2″ CSDVersion=”” Bits=”4″ ServicePackMajorMin=”1″/>
<operatingsystemcondition MajorVersion=”6″ MinorVersion=”2″ PlatformId=”2″ CSDVersion=”” Bits=”4″/>
<operatingsystemcondition MajorVersion=”10″ MinorVersion=”0″ PlatformId=”2″ CSDVersion=”” Bits=”4″/>
<file LocalFile=”.\\4.6\Full\NDP461-KB3102436-x86-x64-AllOS-ENU.exe” URL=”” CheckSum=”864056903748706E251FEC9F5D887EF9″ FileSize=”0,67681000″/>
<execute file=”NDP461-KB3102436-x86-x64-AllOS-ENU.exe” cmdline=”/q /norestart” cmdlinesilent=”/q /norestart” returncodetoreboot=”1641,3010″/>
<properties Id=”{B1C982A7-100D-4691-9DCF-F5986F404DD8}” Description=”This prerequisite installs the .NET Framework 4.6.1 full standalone package.”/>
<behavior Reboot=”32″/>
< /SetupPrereq>


  • The Conditions are set for 64bit only, Windows 7, Windows 8, Windows 10.
  • The download location is good as of 10th March 2017. No telling how long it will last. If the download does not work any more, you would download the offline installer from and then copy it into “C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites\Microsoft .net\4.6\Full” folder
  • If you received similar error as below
    “An error occurred streaming ‘\4.6\Full\NDP461-KB3102436-x86-x64-AllOS-ENU.exe’ into setup.exe”
    You could try to run the InstallShield or VS in Admin mode.

For those new to making a Prerequisite .prq file:

  •  On your desktop create a new text file.
  • Rename this file “Microsoft .NET Framework 4.6.1 Full.prq”
  • Copy the above text to this new file. (Between the +++++)
  • Move this new file to folder C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites
  • Open any InstallShield project
  • Go to the Installation Designer tab > Application Data > Redistributables
  • The list should now contain the new entry “Microsoft .NET Framework 4.6.1 Full”
  • To the right of the list it will say “Needs to be downloaded”
  • Right-click on the item Microsoft .NET Framework 4.6.1 Full.prq and select Download Selected Item…
  • This downloads the 66 MB file to C:\Program Files (x86)\InstallShield\2015\SetupPrerequisites\\4.6\Full\

You should be good.

To edit any of the Conditions:
Right-click on the item Microsoft .NET Framework 4.6.1 Full.prq and select Edit Prerequisite

To Support 32bit and 64bit:
You could remove the “Bits” or leave the value of it to be blank in the above sample, and that will work for both x32 and x64

To find out more on OS version number

To find out more on Value of Release for the .NET Framework

Bootstrap 3 Datepicker (eonasdan) does not work with jQuery 3.0 or above

if you are developing MVC, and you might have chance to look for a DateTimePicker for your MVC project. One of the favorites DateTimePicker is “Bootstrap 3 DatePicker” developed by Eonasdan ( ). You may download and get it from Nuget. You may also install by using Bower, Rails, Angular, Meteor or manually. The latest version in Nuget is v4.15.35.1.


One of the dependency is the jQuery. I have installed the latest one jQuery v3.1.1 at the moment I am writing to this blog.

I have followed the sample code Eonasdan has provided but I could not make it working. After some searching, I found out that Eonasdan has developed it when jQuery was still in v2. And jQuery has some changes from v2 to v3. One of the changes is jQuery does not provide the object.count() for jQuery object. It is changed into object.length

So, now you could make some code changes to the bootstrap-datetimepicker.js and the DatePicker will be working again. There are 2 locations of code that you have to change. Just simply search for “count()” and replace it as “length”.

Hope that my blog will help you to fix it. And as I know, someone has also point this out to the GitHub and commit into a new branch. But Eonasdan has not yet merge it into the release branch. Let’s do this fix in our way before he release the fixed code so that we could get a corrected js from Nuget.


Set menu item to Active in MVC with BootStrap

Recent I start working on MVC with BootStrap for building the great Web UI. I am building a menu with several menu items and found out that it is not setting as “active” in the class of the item when a page is loaded.


By default the MVC template doesn’t add the active class to the “li” item in the menu. So I have to add the class=”active” to the “li” to indicate the active menu item.


Above is the code that is used for the actual menu that create the menu in the first screenshot. if you look at line 8, you will see the class=”active”, this is what makes the active menu item. In order for us to do this, we need to know what page is currently loaded and then apply the active class css to the corresponding “li” element. The best way to do this, is to create a HTML helper to handle this for us.

Now, let’s try to create a new folder in the project and called “Helpers”. Then add a new class named “HtmlHelpers.cs” (from my sample, I used KenLinHtmlHelpers). here we could create an extension method of the HtmlHelpers method. We do this by creating a static class.


As you can see, I have created 2 method, IsActive and IsActiveController. The only difference is, do you want to take Action into one of the input parameter. If you want to set class is active whenever it is in the specific controller, you could use IsActiveController. Otherwise, you may use IsActive if you want the active class only in exactly the specified Action and Controller. Please also note that, I am letting the activeClass and inActiveClass input as optional with a default value.

Now we could update our cshtml as below,


Look carefully on each “li” item now. There is a new HtmlHelper method to check and show if it is the active controller.  Please also look carefully, I have also called the method in line 9, for the parents of the dropdown Menu.

NOTE: You have to reference the class in the top of the view page that you are using the IsActive or IsActiveController method in. Just add the code as line 1 of the above screenshot.