I am getting the error of System.Deployment.Application.DeploymentDownloadException
when I try to run setup.exe for my ClickOnce application. If run it over the network from its original location it works fine, but if I copy setup.exe
from the path on the server I get the error
Can not download application. The Application is missing required files.
I need the setup as it installs some prerequisites (.NET 4) that the end user may not have.
Clicking the details button from the error window gives the following information:
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.237
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.237 (RTMGDR.030319-2300)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:UserssrchamberlainDownloadsContractFlowTool.application resulted in exception. Following failure messages were detected:
+ Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application did not succeed.
+ Could not find file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
+ Could not find file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
+ Could not find file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [8/16/2011 12:23:26 PM] : Activation of C:UserssrchamberlainDownloadsContractFlowTool.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [8/16/2011 12:23:26 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.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.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
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
- Could not find file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
- 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 file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
- 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.FileNotFoundException
- Could not find file 'C:UserssrchamberlainDownloadsContractFlowTool.application'.
- 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)
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.
The root of the problem is it is trying to download its files from the same path as setup.exe
is run from (file:///C:/Users/srchamberlain/Downloads
in this case) instead of the actual deployment URL (\fs1contractflowtool
)
I have seen a few solutions, but all of them tell me the solution is to change the MIME type on IIS. IIS is not installed on the server that is hosting the files.
What else can be done to fix this besides "change the MIME types"?
UPDATE
See the second post in this thread for some test cases I ran. The summary is: it appears that the setup.exe
file uses the working directory to download its files as it works fine when I run the EXE file over the network, however it fails if I copy the EXE to my local disk.
How do I resolve this issue other than "Tell people to just run it from the network path"?
UPDATE2:
Looking at the setup.exe
file with a hex editor, I could not find my install path anywhere in it. When I changed the install path to http://example.com/Test I was able to find it easily.
Is it a Visual Studio bug that it does not save the publishing location/install path if you are using a UNC path?
See Question&Answers more detail:
os