如何正确发布我的应用程序?

4

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

我现在处于发布/部署/构建阶段。

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

然后它在我的桌面上创建了一个'clickonce'应用程序。 所以我将其上传到Web服务器,下载并尝试运行它。

但是它失败了。 它显示:

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.

我做错了什么? 我是否遗漏了关键步骤? 我需要将清单文件托管到我的服务器并以某种方式指向它吗?

非常感谢任何帮助。

更新 根据评论和答案,我决定将所有给我发布的文件都压缩在一起。压缩文件夹中的文件包括:

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

我随后将文件重新上传到服务器,下载、解压缩并点击Bingo Game.application,但是它仍然出现了与上述相同的错误。


你看到这个了吗?http://stackoverflow.com/questions/24347722/publish-windows-app-to-be-emailed/24347981#24347981 - Gayot Fow
请问您能否添加关于您上传的文件以及下载的文件的信息? - Herdo
在已经回答的人中,似乎有些人对于我上传了什么、是否上传了清单到服务器等方面存在一些困惑。我已经尽可能详细地描述了上述步骤,除此之外我没有做任何其他事情。谢谢。 - RSM
你在这方面进展如何了?问题解决了吗,还是你仍然无法发布? - Paul Michaels
3个回答

2

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

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


0

@rsm:这个微软链接非常不错,而且运作良好。我通过这个教程学会了部署,并且已经成功地从服务器上部署了几个具有自动更新功能的应用程序。 - Arun Thundyill Saseendran

0

在按照之前的答案指示确保您的清单文件与安装文件一起放置在 Web 服务器上后,您需要确保 IIS 提供“.manifest”文件。我相信 IIS 7 默认允许此操作,但如果您使用的是旧版本的 IIS,则可能会出现问题。

请查看将清单扩展名添加到 IIS 上的 MIME 类型


我不在IIS上,而是在Apache Web服务器上。 - RSM

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接