.exe file not recognized after resigning the manifest on ClickOnce Publish - c#

I am using MVS 2015 with .Net Framework 4.5.
I publish my C# WF Application, everything is fine, but I have to obfuscate the .exe from Application Files.
After I do it, obviously, the setup does not recognize anymore the .exe, the hashes are different and so on.
I resign the new .exe added file with Signtool providing the necessary .pfx and password, then I use Mage to update the .manifest and the .application according to the second part of this MSDN documentation.
Everything is successful, but when I run the setup and I hit install, after a while (around 80% of the installation progress) I receive an error that says that there is something wrong with the new .exe file:
PLATFORM VERSION INFO
Windows : 10.0.16299.0 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.7.2556.0 built by: NET471REL1
clr.dll : 4.7.2633.0 built by: NET471REL1LAST_C
dfdll.dll : 4.7.2556.0 built by: NET471REL1
dfshim.dll : 10.0.16299.15 (WinBuild.160101.0800)
SOURCES
Deployment url : file:///E:/share/myApp.application
Application url : file:///E:/share/myApp.exe.manifest
IDENTITIES
Deployment Identity : myApp.exe.application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil
Application Identity : myApp.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6500754c4a44ec95, processorArchitecture=msil, type=win32
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 E:\share\myApp.application resulted in exception. Following failure messages were detected:
+ Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
+ Cannot load internal manifest from component file.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [24.03.2018 11:03:32] : Activation of E:\share\myApp.application has started.
* [24.03.2018 11:03:32] : Processing of deployment manifest has successfully completed.
* [24.03.2018 11:03:32] : Installation of the application has started.
* [24.03.2018 11:03:33] : Processing of application manifest has successfully completed.
* [24.03.2018 11:03:35] : Found compatible runtime version 4.0.30319.
* [24.03.2018 11:03:35] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [24.03.2018 11:03:43] System.Deployment.Application.InvalidDeploymentException (ManifestLoad)
- Exception occurred loading manifest from file myApp.exe: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.Manifest.AssemblyManifest.ManifestLoadExceptionHelper(Exception exception, String filePath)
at System.Deployment.Application.Manifest.AssemblyManifest.LoadFromInternalManifestFile(String filePath)
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.OnModified()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
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, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
What am I doing wrong? What am I missing? :(

I have investigated Marko application, and if you have in use .NET Refactor and have a problem from above here is workaround for get it working:
.Net Reactor has a Visual Studio Add-In that needs installed and configured in the project
Anti ILDASM from .Net Reactor (option that's enabled by default) has to be disabled when obfuscating so that MVS could do the proper packing process
Anyway, if you gonna modify your assemblies after publish you need to recompute hash anyway. How it's possible:
Don't use a Visual Studio publish engine and generate you
application by "mage.exe". It's let to you prepare you source
application first and create ClickOnce application after.
Download utility from second download link [here]. Execute and [Choose] your folder > Change action to [Update] > and [Build]. No more actions required. Update operation will recompute hashs.
If your obfuscator software supports command line parameters then you can add "Post-build event" script in your .exe VS project properties and it will be executed before clickonce build.
"Deploying Obfuscated Assemblies" article you can found here: Securing ClickOnce Applications

Related

Issue Deploying Install/Updates On GitHub with ClickOnce

I've been trying to figure out the best way to deploy a WPF application with ClickOnce. I'd download the setup file from the GitHub URL, and cross my fingers, and run into this every time:
PLATFORM VERSION INFO
Windows : 10.0.15063.0 (Win32NT)
Common Language Runtime : 4.0.30319.42000
System.Deployment.dll : 4.7.2046.0 built by: NET47REL1
clr.dll : 4.7.3130.0 built by: NET472REL1LAST_B
dfdll.dll : 4.7.2046.0 built by: NET47REL1
dfshim.dll : 10.0.15063.0 (WinBuild.160101.0800)
SOURCES
Deployment url : https://github.com/SuperScrub837/tree/master/SuperScrub837/SuperScrub837/publish/SuperScrub837.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of https://github.com/SuperScrub837/tree/master/SuperScrub837/SuperScrub837/publish/SuperScrub837.application resulted in exception. Following failure messages were detected:
+ Exception reading manifest from https://github.com/SuperScrub837/blob/master/SuperScrub837/SuperScrub837/publish/SuperScrub837.application: the manifest may not be valid or the file could not be opened.
+ DTD is prohibited in this XML document.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [8/14/2018 8:21:48 PM] : Activation of https://github.com/SuperScrub837/tree/master/SuperScrub837/SuperScrub837/publish/SuperScrub837.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [8/14/2018 8:21:50 PM] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from https://github.com/SuperScrub837/blob/master/SuperScrub837/SuperScrub837/publish/SuperScrub837.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
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, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Xml.XmlException
- DTD is prohibited in this XML document.
- Source: System.Xml
- Stack trace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I've been trying to follow some blogs that I've found, and have created the following in .gitignore:
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
#Allow publish directory
!publish/
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
Here is the code in my .gitattributes file:
*.manifest binary
*.application binary
*.deploy binary
This is turning out to be a bit more of a pain point for me than I probably should be making it. I want the user to be able to install from the GitHub link, and update the application.
Thoughts?
So, the purpose of publishing my ClickOnce executables on GitHub was to allow updates to be downloaded from this repository as my software was updated. As many people on this website are aware, GitHub discourages downloading raw files since they usually intend themselves to be a repository system for the code itself - they don't want to have long download times, etc.
Keep in mind, at least at the moment this app I've been building is lightweight, so since I don't have an alternative at the moment with my available resources, I've decided to keep these updating executables on the repo itself. If one wants to do that, here's a tip, which you may have seen before - try using the following URL:
https://github.com/SuperScrub837/raw/master/SuperScrub837/SuperScrub837/publish/
Instead of:
https://github.com/SuperScrub837/tree/master/SuperScrub837/SuperScrub837/publish/
in your ClickOnce preferences for the project.
When I used the raw version of the link, the deployed application on another application updated successfully without any errors. Hope this helps and isn't too extra - also, this article may belong on ServerFault or something, so my apologies if that's the case since I posed this question here.
The error exists as you have not used raw GitHub for file hosting. Raw GitHub is essentially like a free FTP server which you can use for free hosting your .NET applications.
Follow the following steps:
(I have also created an illustrative video for the same here: https://youtu.be/iMEGtrjMXPU)
If your project isn't on GitHub, create a repository and push your code there. It has to be public.
On your computer, create a folder called 'published' at the root of your repository. Make sure this folder is not ignored in the .gitignore
Create a file called .gitattributes in this /published folder. Add the following contents
*.manifest binary
*.application binary
*.deploy binary
* -text
Now commit and push to the Github repository. Navigate to this file in the repository click on the RAW button. Copy the URL address till '/publish/'. It will look like this
https://raw.githubusercontent.com/{your-account-name}/{your-repo-name}/{branch}/published/
In the ClickOnce installer enter the following paths
Publish Path:
{repo-path}/pubhished
Install Path:
https://raw.githubusercontent.com/{your-account-name}/{your-repo-name}/{branch}/published/
This is the server address from where the setup will install your application from.
Update Path:
https://raw.githubusercontent.com/{your-account-name}/{your-repo-name}/{branch}/published/
This is the server address from where the setup will check for updates.
NOTE: Use this link to navigate through the clickonce installer:
https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-using-clickonce-folder?view=vs-2022.
Make sure the check the 'Create Desktop Shortcut' option before publishing. Now commit and push your code.
Now in the /published folder click on the setup to install the application. This will connect the GitHub servers to download and install the required files on your computer in the directory C:\Users\vib28\AppData\Local\Apps\2.0.
To publish an update for the application follow these steps
Make the changes to your c# applicaiton.
Publish the application again (to the same folder /published). The revision number should increase, and there should be a new folder added to the location /published/Application Files
Commit and push your code to GitHub. Now the raw files have been updated. So whenever the client runs his application, it will automatically prompt for downloading the update.

ClickOnce won't run - Getting 'Specified Cast Not Valid'

I have a C# app that we deploy on Win7 machines (using ClickOnce) without any issues (for years now) but we have a few employees with a Surface Pro 2 (8.1) and the app won't install. When they run the setup.exe they get the standard "contact your administrator for details" error. Here's the log that it produces:
PLATFORM VERSION INFO
Windows : 6.2.9200.0 (Win32NT)
Common Language Runtime : 4.0.30319.34014
System.Deployment.dll : 4.0.30319.33440 built by: FX45W81RTMREL
clr.dll : 4.0.30319.34014 built by: FX45W81RTMGDR
dfdll.dll : 4.0.30319.33440 built by: FX45W81RTMREL
dfshim.dll : 6.3.9600.16384 (winblue_rtm.130821-1623)
SOURCES
Deployment url : file://asc-server/public/Programs/Installs/SCS/SCS.application
Deployment Provider url : file://asc-server/public/Programs/Installs/SCS/SCS.application
Application url : file://asc-server/public/Programs/Installs/SCS/Application%20Files/SCS_3_4_0_9/SCS.exe.manifest
IDENTITIES
Deployment Identity : SCS.application, Version=3.4.0.9, Culture=neutral, PublicKeyToken=cc0fb6e85ade2b56, processorArchitecture=x86
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 \\asc-server\public\Programs\Installs\SCS\SCS.application resulted in exception. Following failure messages were detected:
+ Specified cast is not valid.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [6/18/2014 8:19:42 AM] : Activation of \\asc-server\public\Programs\Installs\SCS\SCS.application has started.
* [6/18/2014 8:19:42 AM] : Processing of deployment manifest has successfully completed.
* [6/18/2014 8:19:42 AM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [6/18/2014 8:19:42 AM] System.InvalidCastException
- Specified cast is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.VerifyRequestedPrivilegesSupport(String requestedExecutionLevel)
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)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
I see that it says "Specified Cast is not Valid" but I'm not too sure why we're getting that error. I've tried the following so far (with no luck):
Changed Target CPU from x86 to Any CPU
Changed signing from sha1RSA to sha256RSA
Ran setup.exe as Administrator
Turned off all UAC
Created a basic windows form (1 form, 1 button) and tried to install, but getting same error.
Latest - I took the .exe from the basic windows form app and ran it on the Surface Pro, which it runs fine, so I'm thinking it must be a setting issue.
At this point I'm thinking it's a setting either with the Surface Pro OR a VS deployment setting that I'm missing.
Any ideas or suggestions are greatly appreciated!
This was caused because of the Users security settings.
if you select it as in the picture problem is solved automatically. and you may continue installing.
if you cannot see the picture in the link above;
open Control Panel -> User Account Control Settings
adjust the slider 2nd from top. (Notify me only when the apps try to make changes to my computer (default)

Clickonce installation fails to download

I had made a Clickonce deployemnt to my application set the installation folder and publishing folder the same that is a network share and then it work perfect for my development machine
Then when I went to on client machine opened the network share and I tried to install the application using that setup file i got tht message like below
And in details Iam getting the below message
LATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.586
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.586 (RTMLDR.030319-5800)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file://it-dept/Project/mycutorderlast/CutorderFresh.application
Deployment Provider url : http://it-dept/CutorderFresh/CutorderFresh.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of \\it-dept\Project\mycutorderlast\CutorderFresh.application resulted in exception. Following failure messages were detected:
+ Downloading http://it-dept/CutorderFresh/CutorderFresh.application did not succeed.
+ The remote server returned an error: (404) Not Found.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [08/10/2013 14:03:25] : Activation of \\it-dept\Project\mycutorderlast\CutorderFresh.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [08/10/2013 14:03:30] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://it-dept/CutorderFresh/CutorderFresh.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.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
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
- The remote server returned an error: (404) Not Found.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Can anyone suggest what was the issue As Iam using clickonce for the first time
Check values of 'Publish Location' or 'Installation URL' on Publish tab of properties. According to your current settings, you should have published files accessible by this path: http://it-dept/CutorderFresh/CutorderFresh.application and it looks like they're not available by this path.
Here you can read how to set proper 'Publish Location' and 'Installation URL' values
I had this same issue and it was driving me mad. I knew I had the proper permissions set up on the network's shared folder. I couldn't even install my application from my own machine via the network share. After searching long and hard for an answer I figured it out myself.
On the Publish tab of properties I only filled in the "Publishing Folder Location" with:
\servername\share\Application Folder
I left the "Installation Folder URL" section blank.
Somehow a field in the "Application Updates" section (via clicking "Updates" button on Publish tab) got filled in with a different value than what my network share was. Not sure if I did this myself or if it was set by default. I cleared out the "Update Location (if different than the publish location)" field and that fixed this issue for me. Here is a screen shot of where I changed the field:
I would post a screen shot of the form that was causing me trouble but for some reason I need 10 reputation points to post a picture.
I resolved my problem like yours.
I don't know that "Publishing Folder Location" of my application (below "formtest" App.) is different from "Installation Folder URL".
In fact, two folders of former WEB server for click once deployment were not different. So, I was confused after WEB server was changed.
Publishing Folder Location: \12.39.526.272\root\formtest\
Installation Folder URL: http://12.39.526.272:8080/formtest/
Application Updates section "Update Location (if different than the publish location)" field : http://12.39.526.272:8080/formtest/
I'm so sorry My native language is not English.
I had the same error, but resolved it a different way. Somehow I had accidentially unchecked something in the Options.
On the Publish tab, select "Options". Under Deployment, make sure "Use .deploy file extension" is checked. Once I checked that and republished, the error went away.

Getting error on creating deployment using MageUI

I need to change a database configuration in app.config.exe in a one click application.
I looked up several information in creating the deployment in MageUI.
http://danielbergsten.wordpress.com/2010/12/21/change-application-configuration-in-an-already-published-clickonce-app/
http://community.discountasp.net/showthread.php?t=14370
https://stackoverflow.com/questions/7082410/clickonce-setup-exe-fails-but-the-application-file-works-fine-when-using-a-wind
I found this link to seem the most direct but I did not get rid of my error from following this link either.
ClickOnce and mageUI adding custom file folder problems.
Actually this is exactly what I am looking for in a solution except the solution in the link given did not work for me.
I)
I tried several combinations to see if it would work.
1) sign manifest in application version folder . (.manfest file)
2) sign application deployment in root folder and using newly signed manifest (.application)
3) copy it over to application version.
II)
1) sign manifest in application version folder . (.manfest file)
2) sign application deployment using new manifest.
3) copy application deployment to application version and then sign it again using new manifest in application folder.
III)
1) sign manifest and check add .deploy.
2) sign application deployment in root folder.
3) copy application deployment to application folder.
I am not getting any luck in resolving the error I am getting.
The error I get is when I try running the one application from DEV web server environment is. I get a 404 error and the config file is not found.
If I publish the application from VS it works good.
The issue is I need to change only a production database value and I do not want to publish from VS2010 and Ijust want to use the .exe and config directly from production and just change the config and resign everything using the MageUI. I am trying to do the resign on DEV environment to see if the resigning works when deployed to DEV so I could do the same steps on production. DEV deployment after resigning FAILS.
Please do not suggest mage becuase I am just not able to run mage as a command line though I would like to know how I can do it. I tried that and I get mage not found but MageUI works good.
I am not sure what step I am missing here.
Here is the full error stack trace when I try opening this one click application link using the webserver where I deployed it to.
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.17929
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.17929 built by: FX45RTMREL
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
Application url : http://dev/pfs/priority/DEV/Application%20Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.manifest
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
IDENTITIES
Deployment Identity : PriorityWinApp-DEV.application, Version=1.0.3.128, Culture=neutral, PublicKeyToken=2c3d7f3ec71aa887, processorArchitecture=msil
Application Identity : PriorityWinApp-DEV.exe, Version=1.0.3.128, Culture=neutral, PublicKeyToken=2c3d7f3ec71aa887, processorArchitecture=msil, type=win32
APPLICATION SUMMARY
* Online only application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application resulted in exception. Following failure messages were detected:
+ Downloading http://dev/pfs/priority/DEV/Application Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.config did not succeed.
+ The remote server returned an error: (404) Not Found.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [5/26/2013 12:22:07 PM] : Activation of http://dev/pfs/priority/DEV/PriorityWinApp-DEV.application has started.
* [5/26/2013 12:22:07 PM] : Processing of deployment manifest has successfully completed.
* [5/26/2013 12:22:07 PM] : Installation of the application has started.
* [5/26/2013 12:22:07 PM] : Processing of application manifest has successfully completed.
* [5/26/2013 12:22:09 PM] : Found compatible runtime version 4.0.30319.
* [5/26/2013 12:22:09 PM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [5/26/2013 12:22:10 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://dev/pfs/priority/DEV/Application Files/PriorityWinApp-DEV_1_0_3_128/PriorityWinApp-DEV.exe.config 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.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
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
- The remote server returned an error: (404) Not Found.
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

Application cannot be started error in ClickOnce deployment

I have an application created in Visual C# using ClickOnce.
I send this application to users via a zipped ClickOnce publish folder, however I (the developer) cannot install it, while others have no problems.
I do the following steps:
- In VS 2010, Project settings, Publish tab, click button 'Publish Now'
- In the created directory I run setup (this is the created ClickOnce Setup file)
- I get the error dialog: Application cannot be started. Contact the application vendor.
Btw, I have not signed my application and assigned the application as a Full Trust application.
What I already tried (also according comments):
- When run as administrator (RMB on setup in clickonce in local folder), I get the same error.
- When running it directly from the bin directory, it works ok.
- When adding a sleep for attaching a debugger, it immediately gives the same error.
- I cleared the cache but it does not help.
And below are the complete details:
PLATFORM VERSION INFO
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.261
System.Deployment.dll : 4.0.30319.245 (RTMGDR.030319-2400)
clr.dll : 4.0.30319.261 (RTMGDR.030319-2600)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///D:/PcgTools%20Publish2/PcgTools.application
Application url : file:///D:/PcgTools%20Publish2/Application%20Files/PcgTools_0_5_0_149/PcgTools.exe.manifest
IDENTITIES
Deployment Identity : PcgTools.application, Version=0.5.0.149, Culture=neutral, PublicKeyToken=0000000000000000, 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 D:\PcgTools Publish2\PcgTools.application resulted in exception. Following failure messages were detected:
+ Specified cast is not valid.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
* The manifest for this application does not have a signature. Signature validation will be ignored.
* The manifest for this application does not have a signature. Signature validation will be ignored.
OPERATION PROGRESS STATUS
* [12-3-2012 2:18:04] : Activation of D:\PcgTools Publish2\PcgTools.application has started.
* [12-3-2012 2:18:04] : Processing of deployment manifest has successfully completed.
* [12-3-2012 2:18:04] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [12-3-2012 2:18:04] System.InvalidCastException
- Specified cast is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.VerifyRequestedPrivilegesSupport(String requestedExecutionLevel)
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)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

Categories