title: How to fix ClickOnce "Value does not fall within the expected range" error occuring at deployment to a non-administrator?
body: <p>I have looked at several questions on this site and on other sources, but none I found seems to address my situation, despite the same error message.</p>
  
  <p>I've been publishing updates of this particular application with ClickOnce since 3 years ago. The last update before March this year was January last year. Prior to that I had more or less monthly updates and there were never any issues.</p>
  
  <p>As of March, most of the users have no problems, but several of the users are behind a firewall and have a network and system administrators taking care of network and system security among other things. They all now have the same issue described in the following deployment log:</p>
  
  <pre><code>PLATFORM VERSION INFO
              Windows                                            : 6.1.7601.65536 (Win32NT)
              Common Language Runtime     : 4.0.30319.34209
              System.Deployment.dll                              : 4.0.30319.34280 built by: FX452RTMGDR
              clr.dll                                   : 4.0.30319.34209 built by: FX452RTMGDR
              dfdll.dll                                              : 4.0.30319.34280 built by: FX452RTMGDR
              dfshim.dll                                          : 4.0.41209.0 (Main.041209-0000)
  
  SOURCES
              Deployment url                                              : http://doc.pinova.hr/PinovaMeteoUpdates/PinovaSoft/Updates/PinovaSoft.application
                                                                                            Server                  : Microsoft-IIS/8.5
                                                                                            X-Powered-By  : ASP.NET
              Deployment Provider url                           : http://doc.pinova.hr/PinovaMeteoUpdates/PinovaSoft/Updates/PinovaSoft.application
              Application url                                : http://doc.pinova.hr/PinovaMeteoUpdates/PinovaSoft/Updates/Application%20Files/PinovaSoft_1_5_73_190/PinovaSoft.exe.manifest
                                                                                            Server                  : Microsoft-IIS/8.5
                                                                                            X-Powered-By  : ASP.NET
  
  IDENTITIES
              Deployment Identity                    : PinovaSoft.application, Version=1.5.73.190, Culture=en-US, PublicKeyToken=284eb56ad7414959, processorArchitecture=x86
              Application Identity                      : PinovaSoft.exe, Version=1.5.73.190, Culture=en-US, PublicKeyToken=284eb56ad7414959, processorArchitecture=x86, 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 http://doc.pinova.hr/PinovaMeteoUpdates/PinovaSoft/Updates/PinovaSoft.application 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
              * [16.5.2016. 14:55:39] : Activation of http://doc.pinova.hr/PinovaMeteoUpdates/PinovaSoft/Updates/PinovaSoft.application has started.
              * [16.5.2016. 14:55:39] : Processing of deployment manifest has successfully completed.
              * [16.5.2016. 14:55:39] : Installation of the application has started.
              * [16.5.2016. 14:55:39] : Processing of application manifest has successfully completed.
              * [16.5.2016. 14:55:40] : Found compatible runtime version 4.0.30319.
              * [16.5.2016. 14:55:40] : Request of trust and detection of platform is complete.
  
  ERROR DETAILS
              Following errors were detected during this operation.
              * [16.5.2016. 14:55:40] System.ArgumentException
                             - Value does not fall within the expected range.
                             - Source: System.Deployment
                             - Stack trace:
                                             at System.Deployment.Internal.Isolation.IStore.LockApplicationPath(UInt32 Flags, IDefinitionAppId ApId, IntPtr&amp; Cookie)
                                             at System.Deployment.Application.ComponentStore.LockApplicationPath(DefinitionAppId definitionAppId)
                                             at System.Deployment.Application.SubscriptionStore.LockApplicationPath(DefinitionAppId definitionAppId)
                                             at System.Deployment.Application.FileDownloader.PatchFiles(SubscriptionState subState)
                                             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&amp; downloadTemp)
                                             at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState&amp; subState, ActivationDescription actDesc)
                                             at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String&amp; errorPageUrl)
                                             at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
  
  COMPONENT STORE TRANSACTION DETAILS
              No transaction information is available.
  </code></pre>
  
  <p>I have spoken to one of the admins in those companies and have found out that even previously, the deployment would not succeed unless the user installing/updating the application had administrator privileges (I was not made aware of this and hence I have no error log from that time). As of March, not even a user with full administrator privilages can install/update the application - only an actual admin can do that.</p>
  
  <p>So, what gives? Can non-administrators install a ClickOnce application <em>at all</em> and how?</p>