简体   繁体   中英

clickonce installation failed when trying to deploy files to be downloaded

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.

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

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)

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 (unknown subtype)

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

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

details error are:

 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.

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

thanks in advance

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.

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM