本文介绍如何在 Microsoft Visual Studio 2015年 Microsoft.NET Framework 4.6.1 ClickOnce 应用程序的.NET Framework 4.6.1 添加系统必备项。
Microsoft Visual Studio 2015年更新 1 不包括可更新的系统必备组件列表中 Visual Studio 2015年的.NET Framework 4.6.1 ClickOnce 引导程序包。您可以使用此替代方法在"更多信息部分以更新列表中可用的系统必备组件包含.NET Framework 4.6.1。这些步骤将添加启用 Visual Studio 2015 提供系统必备组件中的.NET Framework 4.6.1 条目所需的文件。
详细信息
如果您需要添加到 ClickOnce 应用程序的.NET Framework 4.6.1 系统必备组件,您可以使用现有的.NET Framework 4.6 包作为基准。若要添加条目,请执行以下步骤︰
-
找到以下文件夹︰
%的程序文件 (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages
-
创建一份 DotNetFX46 文件夹及其所有内容。DotNetFX461的新文件夹的名称。
-
作为管理员启动 Visual Studio。
-
打开以下文件︰
%的程序文件 (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\DotNetFX461\Product.xml
-
在 XML 中进行以下替换︰
-
更新的产品代码︰
从<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode=".NETFramework,Version=v4.6">
自
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode=".NETFramework,Version=v4.6.1">
-
更新包文件项︰
从<!-- 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>自
<!-- 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> -
更新的相关的产品部分︰
从<RelatedProducts> <IncludesProduct Code=".NETFramework,Version=v4.5.1" />
<IncludesProduct Code=".NETFramework,Version=v4.5.2" />
</RelatedProducts>自
<RelatedProducts> <IncludesProduct Code=".NETFramework,Version=v4.6" />
</RelatedProducts> -
更新 SameSite 方案的 XML:
-
更新安装过程中运行该命令时的版本的.NET Framework不包括作为操作系统的一部分︰
Commands:
从<!--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">
自
<!--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">
检测逻辑︰
从<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />
自
<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />
-
更新安装过程中运行该命令时的版本的.NET Framework包括作为操作系统的一部分︰
命令︰
从<!--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">
自
<!--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">
检测逻辑︰
从<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />
自
<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />
跳过系统的版本比 Windows 10
从<!-- Skip install if OS is Win10 or above --><BypassIf Property="VersionNT" Compare=" ValueGreaterThanOrEqualTo " Value="10.0.0" />
自
<!-- Skip install if OS is above Win10--><BypassIf Property="VersionNT" Compare="VersionGreaterThan" Value="10.0.0" />
注意:如果想要完全启用 SameSite 方案,您需要下载 < 插入 FWLink > 从可执行文件并将其保存到您保存此 <产品>.xml 文件所在的文件夹。
-
-
请为 HomeSite 方案相同的更新︰
-
更新安装过程中运行该命令时的版本的.NET Framework不包括作为操作系统的一部分︰
命令︰
从<!-- 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">自
<!--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">
检测的逻辑︰
从<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />
自
<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />
-
更新安装过程中运行该命令时的版本的.NET Framework包括作为操作系统的一部分︰
命令︰
从<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">自
<!--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">
检测逻辑︰
从<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="393297" />
自
<!-- This indicates .NET Framework Full is already installed --><BypassIf Property="DotNet46Full_Release" Compare="ValueGreaterThanOrEqualTo" Value="394271" />
跳的更高版本比Windows 10 系统︰
从<!-- Skip install if OS is Win10 or above --><BypassIf Property="VersionNT" Compare=" ValueGreaterThanOrEqualTo " Value="10.0.0" />
自
<!-- Skip install if OS is above Win10--><BypassIf Property="VersionNT" Compare="VersionGreaterThan" Value="10.0.0" />
-
-
-
更新每个想要进行本地化的语言 Package.XML。此步骤使用英语为例。您想要支持的每种语言重复此步骤。
-
打开下面的文件 (如 Visual Studio 中的管理员)︰
%的程序文件 (x86)%\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\DotNetFX451\en\Package.xml
-
进行下列更新程序︰
-
更新在 Homesite 方案中要下载的文件
从<String Name="DotNetFX46FullWebBootstrapper">http://go.microsoft.com/fwlink/?linkid=528222&clcid=0x409</String>
自
<String Name="DotNetFX461FullWebBootstrapper">http://go.microsoft.com/fwlink/?linkid=671728&clcid=0x409</String>
-
使用查找/替换所有出现的"Microsoft.NET Framework 4.6"到"Microsoft.NET Framework 4.6.1"都更新所有字符串。
-
注意:如果您的应用程序不支持一种语言,删除对不支持的语言的相应文件夹。例如,如果您的应用程序不应本地化为法语的语言,可以在您 DotNetFX461 引导程序的程序包文件夹下删除 \fr 文件夹。
-
.NET Framework 4.6.1 先决条件就是现在准备好使用。若要执行此操作,请执行以下步骤:
-
打开 ClickOnce 应用程序项目中。
-
在发布选项卡上,单击系统必备组件按钮,然后单击.NET Framework 4.6.1 条目。
系统必备组件
若要应用该替代方法,您必须安装 Microsoft Visual Studio 2015年。
适用于
本文适用于以下产品︰
-
Microsoft Visual Studio 2015
支持的操作系统︰
-
Windows 7 SP1 (x 86 和 x64)
-
Windows 8 (x86 和 x64)
-
Windows 8.1 (x86 和 x64)
-
Windows 10 (x86 和 x64)
-
Windows Server 2008 R2 SP1 (x64)
-
Windows Server 2012 (x64)
-
Windows Server 2012 R2 (x64)