有没有办法要求 .NET 3.5 SP1 作为 ClickOnce 应用程序的先决条件?
我有一个 ClickOnce 应用程序,除非客户端计算机具有 .NET 3.5 SP1,否则该应用程序不会运行。当我在故事板上调用 Stop() 时,它会崩溃。在我的客户端虚拟机上安装 SP1 后,一切正常。
我的问题是我正在使用 ClickOnce 进行部署,并且我已将 .NET 3.5 作为先决条件,但我不知道如何要求 SP1。
有什么想法吗?
更新
我已经检查了先决条件对话框,它肯定不存在。我在 Win 7 机器(64 位)上运行 VS 2008。
I have a ClickOnce application that won't run unless the client machine has .NET 3.5 SP1. When Stop() gets called on the Storyboard I'm running it crashes. After I installed SP1 on my client virtual machine everything works perfectly.
My problem is I'm deploying with ClickOnce, and I've made .NET 3.5 a prerequisite, but I don't know how to require SP1 as well.
Any ideas?
UPDATE
I've checked the prerequisites dialog and it's definitely not there. I'm running VS 2008 on a Win 7 box (64 bit).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
转到“属性”/“发布”/“先决条件”,然后单击“.NET Framework 3.5 SP1”(而不是“.NET Framework 3.5”)
:-)
Go to Properties / Publish / Prerequisites and click on ".NET Framework 3.5 SP1" (instead of ".NET Framework 3.5")
:-)
您需要在 Windows SDK 引导程序包文件夹中包含 .NET 3.5 SP1 的引导程序包。对于 Windows 7 上的 VS2008(我的设置),这是:
该文件夹最初在我的计算机上只有名为 DotNetFX35 的子文件夹,该子文件夹用于 .NET FrameWork 3.5 RTM(不是 SP1)。我需要 DotNetFX35SP1,并在 (...)\Windows\v7.0A 下找到了它。我认为 v7.0A 是随 Visual Studio 2010 安装的,但我对此不确定。无论如何,我已经在我的博客网站上提供了引导文件,地址为:
http:// /posts.nilzorblog.com/stackoverflow/DotNetFX35SP1.zip
只需下载此包并将其解压缩到 (...)\Packages 下名为 DotNetFX35SP1 的文件夹中,重新启动 Visual Studio 2008 就可以了!
You need to have the Bootstrap Package for .NET 3.5 SP1 in the Windows SDK bootstrapper package folder. For VS2008 on Windows 7 (my setup), this is:
This folder initially only had the subfolder named DotNetFX35 on my computer, which is for the .NET FrameWork 3.5 RTM (not SP1). I needed DotNetFX35SP1, and found this under (...)\Windows\v7.0A. I think the v7.0A is installed with Visual Studio 2010, but I'm not sure on this. In any case, I've made the bootstrap files available at my blog site at this address:
http://posts.nilzorblog.com/stackoverflow/DotNetFX35SP1.zip
Just download and unzip this package in a folder named DotNetFX35SP1 under (...)\Packages, restart Visual Studio 2008 and you'll be good to go!
出于这个原因(以及其他原因),我不会为最终用户提供最终的 ClickOnce 安装地点。相反,我将他们发送到一个页面/站点,该页面/站点在允许他们安装应用程序之前在他们的 PC 上运行各种检查(.NET Framework 级别就是这样的检查之一)。
如果您需要此应用程序的 FullTrust,则可以在
HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
中检索 REG_SZ 的“版本”,并将其与 3.5.30729.01 进行比较,当您应用程序启动。For this reason (and others), I don't give my end users the final ClickOnce install location. Instead, I send them to a page/site that runs various checks on their PCs before allowing them to install the application (.NET Framework level is one such check).
If you can require FullTrust for this application, you can retrieve REG_SZ at the
HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
for "Version" and compare it against 3.5.30729.01 when your application starts up.