如果选中“检查更新”,则ClickOnce应用程序将失败

时间:2011-01-13 16:57:53

标签: wpf download clickonce

这就是我正在做的事情。我在WPF下创建了一个简单的空白Visual Studio 2010应用程序。我启用ClickOnce部署,设置签名,安全性等,并发布到本地IIS实例。我启动浏览器,点击publish.htm页面,然后安装正确。

接下来,我把一切都搞砸了(毕竟这是测试),重新创建项目,启用ClickOnce,签名等等,但这次我还点击了属性上的'更新...'按钮 - >发布页面。我点击“应用程序应检查更新”复选框,然后选择“应用程序启动前”的单选按钮。我单击“确定”,再次将其发布到本地IIS,然后单击“publish.htm”页面。当我点击“安装”时,我收到一个错误,'无法下载应用程序。该应用程序缺少必需的文件。请联系应用程序供应商以获取帮助。'。

我发现的唯一参考是application.manifest文件中列出的文件缺失,但我似乎无法确定它是什么。如果有人甚至可以简单地指出我正确的方向,我会很感激。

这绝对是404 Not Found错误,但我不知道它指的是什么文件。这是“详细信息”页面 -

PLATFORM VERSION INFO
    Windows             : 6.1.7600.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.1
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.1 (RTMRel.030319-0100)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url          : http://localhost/WpfApplication1/WpfApplication1.application
                        Server      : Microsoft-IIS/7.5
                        X-Powered-By    : ASP.NET
    Deployment Provider url     : http://jerrydev/WpfApplication1/WpfApplication1.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of http://localhost/WpfApplication1/WpfApplication1.application resulted in exception. Following failure messages were detected:
        + Downloading http://jerrydev/WpfApplication1/WpfApplication1.application did not succeed.
        + The remote server returned an error: (404) Not Found.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [1/13/2011 11:05:50 AM] : Activation of http://localhost/WpfApplication1/WpfApplication1.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [1/13/2011 11:05:50 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading http://jerrydev/WpfApplication1/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
        - The remote server returned an error: (404) Not Found.
        - Source: System
        - Stack trace:
            at System.Net.HttpWebRequest.GetResponse()
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

2 个答案:

答案 0 :(得分:0)

您是否发布到localhost并将其安装在同一台计算机上?我问,因为它在URL中有localhost。您是否在“更新”对话框中填写了UpdateURL,或者将其留空?如果它应与安装URL位于同一位置,请将其留空。

您的安装网址是什么样的?

答案 1 :(得分:0)

我在URL中使用localhost(发布,安装,更新);我发现在“localhost”的情况下,发布过程将使用清单中的机器名称。我的问题实际上源于没有更新我的Hosts.etc文件以将我的机器名称映射到'localhost'。修复此问题解决了我在安装clickonce应用程序时遇到的所有问题,以及安装后能够更新的问题。