How to Create .Net Framework Prerequisites Entry in Microsoft Visual Studio 2015

Surprisingly Microsoft’s own Visual Studio 2015 Update 1 doesn’t include by default .NET Framework 4.6.1 ClickOnce Bootstrapper package, which is required to update the prerequisite components list in Visual Studio 2015. Although there is a workaround provided at the “More Information” section so that you can include the updated list of available prerequisites to get a package of .NET framework 4.6.1 included. And the steps in this article elaborate on how you can enable Microsoft visual studio 2015 to offer .NET framework 4.6.1 entry in prerequisite.

How to Create .Net Framework Prerequisites Entry in Microsoft Visual Studio 2015

To get the .NET Framework 4.6.1 as one of the prerequisites to ClickOnce Application, you can use the existing .NET Framework 4.6 package as a baseline. For doing so, follow given below steps carefully:

  • Open the following folder using “Run” dialog:

%Program Files (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages

  • Copy and Paste DotNetFX46 the folder in the same path and rename new folder to DotNetFX461.
  • Open Microsoft Visual Studio as an Administrator.
  • Now locate the following file and open it:
%Program Files (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\DotNetFX461\Product.xml
  • Make following changes in the XML file:
How to Create .Net Framework Prerequisites Entry in Microsoft Visual Studio 2015

Update following product code from:

<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode=".NETFramework,Version=v4.6">

To

<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode=".NETFramework,Version=v4.6.1">

Now update following given package file entry from:

<!-- Defines list of files to be copied on build -->
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="NDP46-KB3045557-x86-x64-AllOS-ENU.exe" HomeSite="DotNetFX46FullWebBootstrapper" PublicKey="3082010A028201010096715DED0646FA84CB9D5BB746C7B0E1B4113903ADB11573609CEBA7B66E1A3C3FFF65E334F1A6A5215E56996C58E492A10A5CC2D3DC522F0C659A20614053319C6C8F217DBAF9FE13505260953A5BB958A5746141A994E0AD264E4CA1977049275E7C67CA4F1E718446BC1D4BB6E20FC5C627C907E67A0AA51700194C7045382D81B450AAC567D1FA79BCC5CCA1729BF4253498F854DF123938122FA46BA59A7EC762D1DCCFED3D34F8B9DF3530BAEC7932A9E1A9AC554D4C7F4C56C3130B76F107F9CC47ACFB88D552A51E28FA3D2DCFCF849886716511CF85C9094486E16FE7B1FCAC4044A5A98B233F82499DD596595013591873FF430CAD2BD47F3040670203010001"/>
<PackageFile Name="NDP46-KB3045560-Web.exe" HomeSite="DotNetFX46FullWebBootstrapper" CopyOnBuild="False" PublicKey="3082010A028201010096715DED0646FA84CB9D5BB746C7B0E1B4113903ADB11573609CEBA7B66E1A3C3FFF65E334F1A6A5215E56996C58E492A10A5CC2D3DC522F0C659A20614053319C6C8F217DBAF9FE13505260953A5BB958A5746141A994E0AD264E4CA1977049275E7C67CA4F1E718446BC1D4BB6E20FC5C627C907E67A0AA51700194C7045382D81B450AAC567D1FA79BCC5CCA1729BF4253498F854DF123938122FA46BA59A7EC762D1DCCFED3D34F8B9DF3530BAEC7932A9E1A9AC554D4C7F4C56C3130B76F107F9CC47ACFB88D552A51E28FA3D2DCFCF849886716511CF85C9094486E16FE7B1FCAC4044A5A98B233F82499DD596595013591873FF430CAD2BD47F3040670203010001"/>
</PackageFiles>

To

<!-- Defines list of files to be copied on build -->
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="NDP461-KB3102436-x86-x64-AllOS-ENU.exe" HomeSite="DotNetFX461FullWebBootstrapper" PublicKey="3082010A028201010096715DED0646FA84CB9D5BB746C7B0E1B4113903ADB11573609CEBA7B66E1A3C3FFF65E334F1A6A5215E56996C58E492A10A5CC2D3DC522F0C659A20614053319C6C8F217DBAF9FE13505260953A5BB958A5746141A994E0AD264E4CA1977049275E7C67CA4F1E718446BC1D4BB6E20FC5C627C907E67A0AA51700194C7045382D81B450AAC567D1FA79BCC5CCA1729BF4253498F854DF123938122FA46BA59A7EC762D1DCCFED3D34F8B9DF3530BAEC7932A9E1A9AC554D4C7F4C56C3130B76F107F9CC47ACFB88D552A51E28FA3D2DCFCF849886716511CF85C9094486E16FE7B1FCAC4044A5A98B233F82499DD596595013591873FF430CAD2BD47F3040670203010001"/>
<PackageFile Name="NDP461-KB3102438-Web.exe" HomeSite="DotNetFX461FullWebBootstrapper" CopyOnBuild="False" PublicKey="3082010A028201010096715DED0646FA84CB9D5BB746C7B0E1B4113903ADB11573609CEBA7B66E1A3C3FFF65E334F1A6A5215E56996C58E492A10A5CC2D3DC522F0C659A20614053319C6C8F217DBAF9FE13505260953A5BB958A5746141A994E0AD264E4CA1977049275E7C67CA4F1E718446BC1D4BB6E20FC5C627C907E67A0AA51700194C7045382D81B450AAC567D1FA79BCC5CCA1729BF4253498F854DF123938122FA46BA59A7EC762D1DCCFED3D34F8B9DF3530BAEC7932A9E1A9AC554D4C7F4C56C3130B76F107F9CC47ACFB88D552A51E28FA3D2DCFCF849886716511CF85C9094486E16FE7B1FCAC4044A5A98B233F82499DD596595013591873FF430CAD2BD47F3040670203010001"/>
</PackageFiles>

Update the related products section from:

<RelatedProducts> <IncludesProduct Code=".NETFramework,Version=v4.5.1" /> <IncludesProduct Code=".NETFramework,Version=v4.5.2" /> </RelatedProducts>

To

<RelatedProducts> <IncludesProduct Code=".NETFramework,Version=v4.6" /> </RelatedProducts>

Update following changes for SameSite scenarios:

The following change will update the command, which executes during the installation of Visual studio when the .NET framework is not included as a part of the operating system. Change from:

<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile="NDP46-KB3045557-x86-x64-AllOS-ENU.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

To

<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile="NDP461-KB3102436-x86-x64-AllOS-ENU.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

Update DetectionLogic in XML by updating from:

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />

To

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />

Now the following step will update the command, which executes during the installation when the .NET framework is included as part of the operating system. Change from:

<!--Command for Operating Systems where netfx is integrated within OS.-->
<Command PackageFile="NDP46-KB3045557-x86-x64-AllOS-ENU.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

To

<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile="NDP461-KB3102436-x86-x64-AllOS-ENU.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

Update DetectionLogic in XML by updating from:

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />

To

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />

Now instruct the command to Skip the system if it’s a later version than Windows 10. Update from:

<!-- Skip install if OS is Win10 or above -->
<BypassIf Property="VersionNT" Compare=" ValueGreaterThanOrEqualTo " Value="10.0.0" />

To

<!-- Skip install if OS is above Win10-->
<BypassIf Property="VersionNT" Compare="VersionGreaterThan" Value="10.0.0" />
P.S: In case if you require SameSite scenario to be fully enabled, you’ll have to download the executable file from <Insert FWLink> and save it in the same folder which has this modified <product>.xml file.

Now, let’s make some changes to HomeSite scenarios. The following step will update the command, which executes during the installation when the .NET framework is not included as part of the operating system. Change from:

<!-- Defines how to invoke the setup for the .NET Framework redist -->
<Commands Reboot="Immediate">
<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile="NDP46-KB3045560-Web.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper /lcid 1033" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="468232836">

To

<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile=" NDP461-KB3102438-Web.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper /lcid 1033" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="468232836">

Update DetectionLogic in XML by updating from:

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />

To

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />

The following step will update the command, which executes during the installation when the .NET framework is included as part of the operating system. Change from:

<Commands Reboot="Immediate">
<!--Command for Operating Systems where netfx is integrated within OS.-->
<Command PackageFile=" NDP46-KB3045560-Web.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

To

<!--Command for downlevel and future Operating Systems where netfx is not integrated within OS.-->
<Command PackageFile=" NDP461-KB3102438-Web.exe" Arguments=" /q /norestart /ChainingPackage FullX64Bootstrapper" EstimatedInstalledBytes="437362964" EstimatedInstallSeconds="600" EstimatedTempBytes="2095870765">

Update DetectionLogic in XML by updating from:

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />

To

<!-- This indicates .NET Framework Full is already installed -->
<BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />

Now instruct the command to Skip the system if it’s a later version than Windows 10. Update from:

<!-- Skip install if OS is Win10 or above -->
<BypassIf Property="VersionNT" Compare=" ValueGreaterThanOrEqualTo " Value="10.0.0" />

To

<!-- Skip install if OS is above Win10-->
<BypassIf Property="VersionNT" Compare="VersionGreaterThan" Value="10.0.0" />
  • If localization is in your requirement set, then you need to update Package.xml for every language. For example, for including support for the English language, do the following steps:

Locate file at following given path and open it in Visual Studio with administrator access:

%Program Files (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\DotNetFX451\en\Package.xml

and make the following changes:

To update the file to be downloaded for Homesite scenarios, change from:

<String Name="DotNetFX46FullWebBootstrapper">http://go.microsoft.com/fwlink/?linkid=528222&amp;clcid=0x409</String>

To

<String Name="DotNetFX461FullWebBootstrapper">http://go.microsoft.com/fwlink/?linkid=671728&amp;clcid=0x409</String>

Find and replace all strings in the file with the text “Microsoft .NET Framework 4.6” and replace it with “Microsoft .NET Framework 4.6.1“.

P.S: If you don’t have a localization requirement or your application doesn’t support a language, then you can delete the corresponding folder to the unsupported language. E.g., if your application doesn’t support localization to the French language, then you can delete the \fr folder from the DotNetFX461 bootstrapper package folder.

  • Now you’re ready to run the ClickOnce application project. Open it.
  • Navigate to Publish Tab and click on the Prerequisites button and then click the .NET Framework 4.6.1 entry.

You can perform above steps on  Windows 7 SP1 (x86 and x64), Windows 8 (x86 and x64), Windows 8.1 (x86 and x64), Windows 10 (x86 and x64), Windows Server 2008 R2 SP1 (x64), Windows Server 2012 (x64), Windows Server 2012 R2 (x64).

4 thoughts on “How to Create .Net Framework Prerequisites Entry in Microsoft Visual Studio 2015”

    • Because people need to know what commands they’ll be running if provided in form of a file. So, this way user has the freedom of doing his own way and gains knowledge too in detail.

      Reply

Leave a Comment