尝试部署要下载的文件时,clickonce安装失败 [英] clickonce installation failed when trying to deploy files to be downloaded

查看:149
本文介绍了尝试部署要下载的文件时,clickonce安装失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我尝试运行时,在我的Win C#应用程序(Visual Studio 2012)中出现"system.deployment.application.deploymentdownloadexception(未知子类型),无法下载应用程序.应用程序缺少所需文件"的错误.我的clickonce应用程序的setup.exe.

i'm getting error of "system.deployment.application.deploymentdownloadexception (unknown subtype),Can not download application. The Application is missing required files" in my win c# apllication (visual studio 2012), when i try to run setup.exe for my clickonce application.

我在设置安装文件夹(共享文件夹)并将其发布(使用visualstudio向导)后,在网络共享中进行了Clickonce部署.

i made a Clickonce deployment after setting the installation folder (share folder) and publish it (with visualstudio wizard) in a network share.

在Visual Studio中,我在网络文件夹中设置了安装文件夹URL:\ srv \ Deploy \,位于Visual Studio向导中用于发布此应用程序的相同位置,以及用户将如何安装应用程序(通过UNC路径或文件共享)

in visual studio i set installation folder URL in my network folder: \srv\Deploy\ that is the same location in visual studio wizard to publish this application and how user will install application (from a UNC path or file share)

在Visual Studio向导完成之后,会自动生成一个部署网页,在这里单击安装按钮(下载setup.exe)以安装我的应用程序.在C:\ Users \ Gio \ Downloads中下载setup.exe当我单击setup.exe时,会生成错误:

After visual studio wizard, automatically is generated deployment web page, where i click install button (downloading setup.exe) to install my application. setup.exe is downloaded in C:\Users\Gio\Downloads and when i click setup.exe an error is generated:

system.deployment.application.deploymentdownloadexception(未知子类型)

system.deployment.application.deploymentdownloadexception (unknown subtype)

我尝试在默认网站中添加mime类型(.config,.manifestapplication),但错误的出现方式相同

i have tried to add mime type (.config,.manifestapplication) in default web site but error appears in the same way

如果我从网络文件夹\ srv \ Deploy \中运行安装程序,则安装程序可以正常运行.

if i run setup from my network folder \srv\Deploy\, setup works fine.

详细错误为:

 PLATFORM VERSION INFO
Windows             : 6.1.7601.65536 (Win32NT)
Common Language Runtime     : 4.0.30319.18444
System.Deployment.dll       : 4.0.30319.34244 built by: FX452RTMGDR
clr.dll             : 4.0.30319.18444 built by: FX451RTMGDR
dfdll.dll           : 4.0.30319.34244 built by: FX452RTMGDR
dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
URL distribuzione           : file:///C:/Users/Gio/Downloads/ClickOnce.application

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later  in the log.
* Activation of  C:\Users\Gio\Downloads\ClickOnce.application ha causato un'eccezione. Sono stati rilevati i messaggi di errore seguenti:
    + Downloading file: file:///C:/Users/Gio/Downloads/ClickOnce.application.
    + Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.
    + Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.
    + Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [27/01/2015 14:43:19] : Activation of C:\Users\Gio\Downloads\ClickOnce.application avviata.

ERROR DETAILS
Following errors were detected during this operation.
* [27/01/2015 14:43:19] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
    -  Downloading file file:///C:/Users/Gio/Downloads/ClickOnce.application.
    - Source: System.Deployment
    - Stack trace:
        in  System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        in System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
        in System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
        in System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
        in System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
        in System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
        in System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
        in System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
    --- Inner Exception ---
    System.Net.WebException
    - Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.
    - Source: System
    - Stack trace:
        in System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
        in System.Net.FileWebRequest.GetResponse()
        in System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
    --- Inner Exception ---
    System.Net.WebException
    - Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.
    - Source: System
    - Stack trace:
        in System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
        in System.Net.FileWebRequest.GetResponseCallback(Object state)
    --- Inner Exception ---
    System.IO.FileNotFoundException
    - Could not find file 'C:\Users\Gio\Downloads\ClickOnce.application'.
    - Source: mscorlib
    - Stack trace:
        in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
        in 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)
        in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
        in System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
        in System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
        in System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

从网页上的安装按钮单击,我需要设置什么来安装setup.exe?

what do i have to set to install setup.exe clicking from install button in web page?

预先感谢

推荐答案

如果您的浏览器尝试下载 setup.exe 文件而不是开始安装,那么据我的经验显示,有两个可能的主要原因.

If your browser tries to download the setup.exe file instead of starting the installation, then as far as my experiences showed, there are two main possible reasons.

首先,您可能没有使用IE.我只设法通过IE正确运行ClickOnce,其他所有浏览器均无法正常工作.

First, you're probably not using IE. I've only ever managed to properly run ClickOnce with IE, none of the other browsers worked.

第二,您没有定义正确的mime类型.对于Apache(易于移植到IIS web.config),我在 .htaccess 文件中使用以下配置:

Second, you don't have the correct mime types defined. For Apache (easily portable to IIS web.config) I use this configuration in a .htaccess file:

AddType application/x-ms-application application
AddType application/x-ms-manifest manifest
AddType application/octet-stream deploy

这在IE上工作正常,但是,我从未尝试过使用本地Web服务器.我通常在本地通过仅运行 .application 文件来测试设置.

This works fine with IE, however, I never tried with a local web server. Locally I usually test the setup by just simply running the .application file.

这篇关于尝试部署要下载的文件时,clickonce安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆