【发布时间】:2014-04-25 02:28:36
【问题描述】:
我阅读了一些关于如何进行 ClickOnce 部署的文档,现在我正在尝试部署一个 hello world 应用程序。
我有一个 WPF 默认应用程序(只是一个空窗口)。
这就是我的工作:
- 打开项目属性。
- 打开发布向导。
- 选择本地服务器。我使用 Visual Studio (File/New/WebSite) 创建了一个网站,然后我可以从列表中选择它。我使用了名为 Test1 的那个。
- 然后选择显示应用程序将在线和离线使用的选项
- 发布
- 现在我运行 ISS Express 服务器并转到如下所示的
http://localhost:6507/publish.htm:
- 我点击发布按钮并下载 setup.exe。
- 但是当我启动 setup.exe 时出现以下错误:
-
日志是:
The following properties have been set: Property: [AdminUser] = true {boolean} Property: [InstallMode] = HomeSite {string} Property: [NTProductType] = 1 {int} Property: [ProcessorArchitecture] = AMD64 {string} Property: [VersionNT] = 6.2.0 {version} Running checks for package 'Microsoft .NET Framework 4.5 (x86 and x64)', phase BuildList Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full' Read string value '4.5.50938' Setting value '4.5.50938 {string}' for property 'DotNet45Full_TargetVersion' The following properties have been set for package 'Microsoft .NET Framework 4.5 (x86 and x64)': Property: [DotNet45Full_TargetVersion] = 4.5.50938 {string} Running checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true Result of checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' is 'Bypass' Running checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet45Full_TargetVersion' and value '4.5.50709': true Result of checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' is 'Bypass' 'Microsoft .NET Framework 4.5 (x86 and x64)' RunCheck result: No Install Needed Launching Application. URLDownloadToCacheFile failed with HRESULT '-2146697208' Error: An error occurred trying to download `http://agarwaen-pc:6507/WpfApplication1.application`.
我对此感到困惑,因为它是一个 Hello World 示例并且无法正常工作。我需要部署一个复杂得多的项目。 任何帮助将不胜感激。 提前致谢。
PD:我认为错误的原因可能是我正在使用的服务器。我的意思是我只是指向一个具有发布页面的项目,然后右键单击 在浏览器中显示 以启动 ISS 服务器。可能安装程序无法下载所需的文件,因为服务器没有提供这些文件。
编辑: 我移至非 Express 版本的 ISS,setup.exe 文件现在可以成功下载。现在,当应用程序尝试下载剩余文件时,我收到另一个下载错误。消息说无法建立连接,因为目标机器主动拒绝了它
消息是:
PLATFORM VERSION INFO
Windows : 6.2.9200.0 (Win32NT)
Common Language Runtime : 4.0.30319.18408
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.18408 built by: FX451RTMGREL
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : http://agarwaen-pc/WpfApplication1.application
Server : Microsoft-IIS/8.0
Deployment Provider url : http://agarwaen-pc:6507/WpfApplication1.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://agarwaen-pc/WpfApplication1.application resulted in exception. Following failure messages were detected:
+ Downloading http://agarwaen-pc:6507/WpfApplication1.application did not succeed.
+ Unable to connect to the remote server
+ No connection could be made because the target machine actively refused it 10.6.53.219:6507
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [4/25/2014 12:15:27 AM] : Activation of http://agarwaen-pc/WpfApplication1.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [4/25/2014 12:15:33 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://agarwaen-pc:6507/WpfApplication1.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- Unable to connect to the remote server
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Inner Exception ---
System.Net.Sockets.SocketException
- No connection could be made because the target machine actively refused it 10.6.53.219:6507
- Source: System
- Stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
【问题讨论】:
-
调出 Fiddler。看起来
http://mypcname:6507/WpfApplication1.application不等于http://localhost:6507/WpfApplication1.application。 -
@Aron 真正的消息是:
http://agarwaen-pc:6507/WpfApplication1.application和agarwaen-pc是我的电脑的名称。我会解决这个问题以避免混淆。对不起。 -
我意识到了这一点。但是...如果您使用带有 IIS 的虚拟主机,它们就不一样了。此外,IIS Express 不允许您使用除
localhost之外的任何地址访问它。将您的浏览器指向该地址,看看它是否下载了一些东西。 -
@Aron 那一定是错误。当我在浏览器中指向
http://agarwaen-pc:6507/WpfApplication1.application时,我得到Bad Request。我必须使用 IIS(不是 Express)吗? -
IIS Express 的设计存在一些缺陷,以防止您在生产中使用它。在这种情况下,
localhost缺陷将阻止您使用它,并且您需要(手动)重写部署脚本中的所有内容以使用localhost。最好直接切换到 IIS。
标签: deployment clickonce