0

I'm having trouble with ClickOnce and a WinForms application, .Net version 4. I can install the application and it works fine with say version 2.1.79.1.

I then do nothing except change the publish version to 2.1.79.2 and recompile and publish. When I run the app it updates correctly and restarts without a problem.

Then I do nothing except change the publish version to 2.1.79.3 and recompile and publish. When I run the app it appears to update correctly (no error messages) but when the app tries to restart there is a message that says 'Application cannot be started' and I get the 'Value does not fall within the expected range' error listed below.

So I uninstall the program and then reinstall. Version 2.1.79.3 runs fine.

I do nothing except change the publish version to 2.1.79.4 and recompile and publish. Everything is fine. I change to version 2.1.79.5, recompile and publish, everything is find. I change to 2.1.79.6, the update seems to run but restarting the app gives the 'Value does not fall within the expected range' error.

I am literally doing nothing between these builds except changing last number of the Publish version on the Publish tab in the project properties. No code is being changed. Every third build and publish is consistently failing in this way.

Does anyone have any idea what could be happening or any suggestions as to how I could troubleshoot this?

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.2046.0 built by: NET47REL1
dfdll.dll           : 4.7.2046.0 built by: NET47REL1
dfshim.dll          : 10.0.15063.0 (WinBuild.160101.0800)

SOURCES
Deployment url          : file:///C:/Users/MyUser/Desktop/MyAppName.appref-ms%7C

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\MyUser\Desktop\MyAppName.appref-ms| resulted in exception. Following failure messages were detected:
    + Value does not fall within the expected range.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [5/8/2017 9:06:00 AM] : Activation of C:\Users\MyUser\Desktop\MyData.appref-ms| has started.
* [5/8/2017 9:06:00 AM] : Performing necessary update check as specified by the deployment.

ERROR DETAILS
Following errors were detected during this operation.
* [5/8/2017 9:06:00 AM] System.ArgumentException
    - Value does not fall within the expected range.
    - Source: System.Deployment
    - Stack trace:
        at System.Deployment.Application.NativeMethods.CorLaunchApplication(UInt32 hostType, String applicationFullName, Int32 manifestPathsCount, String[] manifestPaths, Int32 activationDataCount, String[] activationData, PROCESS_INFORMATION processInformation)
        at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
        at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
        at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, AssemblyManifest appManifest, String activationParameter, Boolean useActivationParameter)
        at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
        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)

COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
Terry
  • 1,889
  • 2
  • 12
  • 8
  • why are you manually changing the version? with clickonce the version increments automatically in every publish – Jonathan Applebaum May 08 '17 at 21:01
  • @jonathana This is how you troubleshoot. It wasn't working so I broke it down to the bare minimum of changes. Nothing was changing about the code itself. I wasn't adding, removing, or changing any libraries or references. The only thing that changed in between builds was the version number and I would not get the error and then I would get the error. – Terry May 09 '17 at 12:16
  • @jonathana Also, automatically incrementing the version number is optional. If you want to control it yourself for whatever reason you can but that's not relevant to my question. – Terry May 09 '17 at 12:18
  • did you read that(?): http://stackoverflow.com/questions/1166233/clickonce-error-value-does-not-fall-within-the-expected-range – Jonathan Applebaum May 09 '17 at 12:29
  • @jonathana Yes and I think most of the other relvant posts on StackOverflow. The stack trace in that one is different from what I'm getting so I think that is probably a different issue. The solutions listed either don't work, I don't have an '&' in my path, or they aren't really solutions, clearing the cache is a workaround, not a solution. – Terry May 09 '17 at 13:10
  • maybe you have tried it but what i would do is: 1. Check Build - Configuration Manager, and make sure the project is checked 2. on each project right click >> add reference >> Projects >> uncheck each dll and then again check each dll – Jonathan Applebaum May 09 '17 at 13:31
  • @jonathana I tried that, didn't make a difference. Install it, runs fine. Update it, runs fine. Update it, gets the error. Uninstall and reinstall, runs fine. Update it runs fine. Update it, gets the error. etc. etc. etc. – Terry May 09 '17 at 15:42
  • is it a network path? if so did you check your active directory privileges? maybe they change every `gpupdate` (Refreshes local and Active Directory-based Group Policy settings) As a click once application it is a network resource and not a local resource. – Jonathan Applebaum May 09 '17 at 17:12

0 Answers0