If you try to install your ClickOnce application and get errors like this I’ll show you what Microsoft recomends you to do:
SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://xxx.xxx.xxx.xxx/App.application resulted in exception. Following failure messages were detected:
+ Failed while downloading http://xxx.xxx.xxx.xxx/App.exe.manifest
+ The remote server returned an error: (404) Not Found.
Your problem is probably that your deployment contain files that the webserver (if a webserver installation) doesn’t support download. The fix is to change the mime types to the current webserver.
The only problem with web server hosting is that web servers use different file types differently. For example, by default a file that has the .config extension will not be downloadable from a web server. The web server will restrict access to it. To work around this, you can create a web.config file in the folder that contains the application files, with contents similar to the following.
Source: Deploying Microsoft Dynamics NAV Using ClickOnce
From the same source you can find the following example to handle this problem:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <directoryBrowse enabled="true" /> <staticContent> <mimeMap fileExtension=".config" mimeType="application/x-msdownload" /> <mimeMap fileExtension=".tlb" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".olb" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".pdb" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".hh" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".xss" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".xsc" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".stx" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".msc" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".flf" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".rdlc" mimeType="application/x-msdownload"/> <mimeMap fileExtension=".sln" mimeType="application/x-msdownload"/> </staticContent> <security> <requestFiltering> <fileExtensions> <remove fileExtension=".config" /> </fileExtensions> </requestFiltering> </security> </system.webServer> </configuration>
If you don’t come from the Dynamics NAV community you can also read this link for more information: Troubleshooting Specific Errors in ClickOnce Deployments
If you come from the Dynamics NAV community this is not the entire truth. If you have visited the official Microsoft documentation about ClickOnce deployment (Deploying Microsoft Dynamics NAV Using ClickOnce) you know that you should copy your client installationf folder to the ClickOnce application folder but the following apply:
Run setup.exe to install the Microsoft Dynamics NAV Windows client. Do not install unnecessary client components, such as the Microsoft Dynamics NAV Development Environment and the Excel add-in. These add to the download size, and contain special file types that can create problems for a ClickOnce deployment. For example, the Web.config file installed with the development environment can create problems when it is hosted on a web server.
This means that you should install your ClickOnce deployment BEFORE you have installed the developer client. But in many cases you have already done this and that can lead to these type of problems even if you uninstall the development client. That´s why I’m going to talk about what the “real solution is”.
When you use the 1VM/2VM script to install NAV in Azure the script creates a complete ClickOnce deployment. Among one of the sub scripts we can find this script that creates the ClickOnce deployment and removes the unnecessary files. The script is located in the installation folder at the following location: WindowsPowerShellScripts\Cloud\NAVAdministration\ClickOnce\Copy-ClientFilesToApplicationFilesDirectory.ps1
<# .SYNOPSIS This cmdlet copies relevant files from the RTC installation folder to the specified ClickOnce application files. .DESCRIPTION This cmdlet copies relevant files from the RTC installation folder to the specified ClickOnce application files. It skips files that are not needed in end-user scenarios such as CSIDE files. .PARAMETER WinClientDirectory Specifies the directory where the Windows client is installed. .PARAMETER ClickOnceApplicationFilesDirectory Specifies the directory that should hold the ClickOnce application files, i.e., the directory to copy to. #> function Copy-ClientFilesToApplicationFilesDirectory { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [string] $WinClientDirectory, [parameter(Mandatory=$true)] [string] $ClickOnceApplicationFilesDirectory ) PROCESS { # Copy all the WinClient files to the Deployment\ApplicationFiles folder Write-Verbose "Copying files from $WinClientDirectory to $ClickOnceApplicationFilesDirectory..." Copy-Item $WinClientDirectory\* -destination $ClickOnceApplicationFilesDirectory -recurse Write-Verbose "Done copying files from $WinClientDirectory to $ClickOnceApplicationFilesDirectory." # Delete files that are not needed for a ClickOnce-deployed win client Write-Verbose "Deleting files from $ClickOnceApplicationFilesDirectory that are not needed for a ClickOnce-deployed win client..." Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory 'fin*') -force # 12 MB, developer files Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory 'cside*') -force # 13 MB, developer files RemoveUnnecessaryClickOnceDirectory (Join-Path $ClickOnceApplicationFilesDirectory 'ReportLayout') # <1 MB, developer files Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory 'master.*') -force # <1 MB, developer files Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory '*.msc') -force # <1 MB, developer files Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory '*.tlb') -force # <1 MB, developer files RemoveUnnecessaryClickOnceDirectory (Join-Path $ClickOnceApplicationFilesDirectory 'Add-ins\OLSync') # <1 MB, Outlook Synchronization RemoveUnnecessaryClickOnceDirectory (Join-Path $ClickOnceApplicationFilesDirectory 'Add-ins\CodeViewer') # 2 MB, developer files Remove-Item (Join-Path $ClickOnceApplicationFilesDirectory '*ExcelAddin*') -force # <1 MB, Excel add-in doesn't work with ClickOnce RemoveUnnecessaryClickOnceDirectory (Join-Path $ClickOnceApplicationFilesDirectory 'Add-ins\OpenXML') # <1 MB, Only used by Excel add-in, and causes problems for ClickOnce Write-Verbose "Done deleting files from $ClickOnceApplicationFilesDirectory that are not needed for a ClickOnce-deployed win client." } }
The above code would solve the following error with downloading file: Deployment/ApplicationFiles/Microsoft.Dynamics.Nav.Client.WinForms.tlb
Antoher error I have gotten is failing to download: /Deployment/ApplicationFiles/<LANGUAGE_CODE>/fin.stx were <LANGUAGE_CODE> is the language code to the language files (FRA,ENU,SVE…). If you get this problem just delete the <LANGUAGE_CODE> folder.
I hope this solves your problem!