【问题标题】:How do I correctly publish my app?如何正确发布我的应用程序?
【发布时间】:2014-06-24 18:53:20
【问题描述】:

我正在使用 Visual Studio 创建我的第一个 Windows 桌面 c# wpf 应用程序。

我正处于我想要发布/部署/构建它的阶段。

在 Visual Studio Express 2013 中,我右键单击我的项目并单击发布,我单击下一步并将发布位置保留为默认值,因为我不知道应该放什么,接下来我选择让用户从 cd-rom/dvd 安装并告诉它不要检查更新并单击完成。

然后它会在我的桌面上创建一个“clickonce”应用程序。所以我上传了一个网络服务器,下载它,然后尝试运行它。

失败了。

上面写着:

Cannot download the application. The application is missing required files. Contact application vendor for assistance. 

如果我点击详细信息,我会得到更详细的信息:

PLATFORM VERSION INFO
    Windows             : 6.2.9200.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.18449
    System.Deployment.dll       : 4.0.30319.17929 built by: FX45RTMREL
    clr.dll             : 4.0.30319.18449 built by: FX451RTMGDR
    dfdll.dll           : 4.0.30319.17929 built by: FX45RTMREL
    dfshim.dll          : 4.0.41209.0 (Main.041209-0000)

SOURCES
    Deployment url          : file:///C:/Users/Lanboy/Downloads/Bingo%20Game.application

IDENTITIES
    Deployment Identity     : Bingo Game.application, Version=1.0.0.1, Culture=neutral, PublicKeyToken=a82aa93ff33fa9be, processorArchitecture=msil

APPLICATION SUMMARY
    * Installable application.

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\Lanboy\Downloads\Bingo Game.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/Lanboy/Downloads/Application Files/Bingo Game_1_0_0_1/Bingo Game.exe.manifest did not succeed.
        + Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.
        + Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.
        + Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [24/06/2014 19:49:15] : Activation of C:\Users\Lanboy\Downloads\Bingo Game.application has started.
    * [24/06/2014 19:49:15] : Processing of deployment manifest has successfully completed.
    * [24/06/2014 19:49:15] : Installation of the application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [24/06/2014 19:49:15] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file:///C:/Users/Lanboy/Downloads/Application Files/Bingo Game_1_0_0_1/Bingo Game.exe.manifest 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.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
            at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)
            at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
            at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
            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
        - Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Net.FileWebRequest.GetResponse()
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.DirectoryNotFoundException
        - Could not find a part of the path 'C:\Users\Lanboy\Downloads\Application Files\Bingo Game_1_0_0_1\Bingo Game.exe.manifest'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

我做错了什么? 我错过了关键的一步吗? 我是否需要在我的服务器上托管清单文件并以某种方式指向它?

非常感谢任何帮助。

更新 根据 cmets and answer,我决定将发布时提供给我的所有文件压缩并压缩。 zip 文件夹中的文件包括:

Bingo Game.application
Bingo Game.exe.config.deploy
Bingo Game.exe.deploy
Bingo Game.exe.manifest

然后我重新上传到服务器,下载,解压缩并单击 Bingo Game.application,但它失败并出现与上述完全相同的错误。

【问题讨论】:

  • 能否请您添加有关您上传的文件以及下载的文件的信息?
  • 在已经回答的人那里。似乎对我上传/尚未上传的内容、向服务器显示的内容等有些混淆,我在上面尝试过尽可能多地提供细节,除了上述步骤之外我什么也没做。谢谢
  • 你从哪里得到这个?问题是否已解决,还是您仍然无法发布?

标签: c# visual-studio-2013 clickonce publish


【解决方案1】:

有几件事需要检查;首先,您在发布应用程序时是否看到以下目录结构(如果没有,那么这就是您可能想要的结构):

BingoGame
    Application Files
        Bingo Game_1_0_0_0
            *.deploy
            Bingo.Game.exe.manifest
        Bingo Game_1_0_0_1
            *.deploy
            Bingo.Game.exe.manifest
    Bingo.Game.Application
    setup.exe

这些文件应该在您从中下载的服务器上(它看起来确实像清单一样可疑)。

同样重要的是,自构建以来,没有任何文件发生变化;如果他们有,而您不想或无法重建,请查看mage

【讨论】:

    【解决方案2】:

    您似乎只上传了文件的一部分。您可以从下图中看到 ClickOnce 进程生成多个文件。您似乎没有复制 .manifest 文件,因此 ClickOnce 应用无法验证程序是否损坏。

    MS Site

    来源:http://msdn.microsoft.com/en-us/library/ff699352.aspx

    【讨论】:

    • @rsm :这个 MS 链接非常好,工作正常。使用本教程,我学习了部署,并通过自动更新从服务器部署了多个应用程序。
    【解决方案3】:

    按照前面答案的指示确保清单文件与设置文件一起位于 Web 服务器上后,您需要确保 IIS 正在提供“.manifest”文件。我相信 IIS 7 默认允许这样做,但如果您使用的是旧版本的 IIS,这可能是问题所在。

    查看Adding the Manifest Extension to the MIME Types on IIS

    【讨论】:

    • 我不在 IIS 上,我在 Apache Web 服务器上。
    猜你喜欢
    • 1970-01-01
    • 2022-06-28
    • 1970-01-01
    • 1970-01-01
    • 2014-08-18
    • 2021-12-15
    • 1970-01-01
    • 1970-01-01
    • 2019-12-05
    相关资源
    最近更新 更多