Here's a fun way to spend a better half of the day 🙂 We have a reasonably complex WinForms application that creates wizards and generates URLs for a given environment to access that wizard. The server names vary, and the WinForms app generates the proper URLs based on some configuration settings.
We recently moved our test web server to a new machine, and had to update the configuration file for the Test build of our WinForms application. We updated the configuration file to point to the correct server, incremented the version in AssemblyInfo to force an auto-update through ClickOnce, re-built the WinForm solution, and updated the ClickOnce deployment files for the Test environment. All is well with the world!
Two machines update their WinForms client without an issue. The third client (Vista 5744 x64) receives an "Application could not start, please contact the software vendor" error. We look in the details and see the following:
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\gaisen.000\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft Global Marketing Platform\RegSys
Builder (Test).appref-ms resulted in exception. Following failure messages were detected:
+ Activation failed.
+ The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
Following errors were detected during this operation.
* [11/2/2006 4:49:09 PM] System.Deployment.Application.DeploymentException (Activation)
- Activation failed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, Uri activationUri)
at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, Uri activationUri)
at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, Uri
at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, TempFile& deployFile)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
The logs don't indicate what file can't be found and the difference between the two versions was a minor configuration change. We go through a seemingly endless loop of rebuilding, uninstalling, clearing internet cache, clearing the mage cache, clearing the auto-generated ClickOnce folders, reinstalling, looking through newsgroups and searches, and don't come up with anything. Searches yielded people with similar issues, but nothing quite the same.
However, when comparing the directory structure between the old version and new version, we notice that the old version contained all the previous PDB files. The new version was built in release mode, so the PDB files weren't present in the new build. We rolled back to the old version and everything ran fine. So, after uninstalling/clearing caches on my machine, we re-deployed the debug version of the new build. And with that, the application started working properly again.
There's a few things that seem off with this:
- The ClickOnce upgrade process worked for multiple x86 machines, only failing on the x64 Vista box.
- The error logs indicated that a file wasn't found and that activation was failing, but failed to provide any additional information.
- The PDB files had seemingly no reason to be required as a part of activation.
I'm new to ClickOnce, so I'm not familiar with the "ins and outs", but all this behavior seems really strange. If anyone has additional insights on this, I'd love to hear from you 🙂