title: "Value Does not fall in the expected range" ClickOnce Deployment
body: <p>I've had a ClickOnce app in use for a few months now, but recently started getting an error on my deployment of the latest version. With this latest version I've added a reference to a DLL that I hadn't used before (<a href="http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples/CSharp.htm" rel="noreferrer">FTD2XX_NET.dll</a> if it's relevant), and suspect that this is related to the issue but I cannot figure out how to fix it.</p>
  <p>The actual project being deployed references another library project, which is what references the DLL (it references other DLL's but that has worked for months and they haven't changed). Following <a href="https://stackoverflow.com/questions/1166233/clickonce-error-value-does-not-fall-within-the-expected-range">these</a> <a href="https://stackoverflow.com/questions/699173/clickonce-deployment-errors">threads</a> I've tried deleting my &quot;Local Settings/Apps&quot; folder and rebooting multiple times, as well as recreating the project and deploying to a different location. The error exists on multiple machines so I do not suspect it's user profile corruption. Here is the full error I'm given:</p>
  <pre><code>PLATFORM VERSION INFO
      Windows             : 5.1.2600.196608 (Win32NT)
      Common Language Runtime     : 4.0.30319.261
      System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
      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://nt_server/prog/Publish/Digipot%20Utility/Digipot%20Utility.application
      Deployment Provider url     : file://nt_server/Prog/Publish/Digipot%20Utility/Digipot%20Utility.application
      Application url         : file://nt_server/prog/Publish/Digipot%20Utility/Application%20Files/Digipot%20Utility_1_0_0_72/Digipot%20Utility.exe.manifest
  
  IDENTITIES
      Deployment Identity     : Digipot Utility.application, Version=1.0.0.72, Culture=neutral, PublicKeyToken=1e3769a7c667fbc1, processorArchitecture=msil
      Application Identity        : Digipot Utility.exe, Version=1.0.0.72, Culture=neutral, PublicKeyToken=1e3769a7c667fbc1, 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 \\nt_server\prog\Publish\Digipot Utility\Digipot Utility.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
      * [3/14/2012 10:17:15 AM] : Activation of \\nt_server\prog\Publish\Digipot Utility\Digipot Utility.application has started.
      * [3/14/2012 10:17:15 AM] : Processing of deployment manifest has successfully completed.
      * [3/14/2012 10:17:15 AM] : Installation of the application has started.
      * [3/14/2012 10:17:15 AM] : Processing of application manifest has successfully completed.
      * [3/14/2012 10:17:17 AM] : Found compatible runtime version 2.0.50727.
      * [3/14/2012 10:17:17 AM] : Detecting dependent assembly Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil using Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil.
      * [3/14/2012 10:17:17 AM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
      * [3/14/2012 10:17:17 AM] : Detecting dependent assembly NationalInstruments.Common.Native, Version=8.6.35.131, Culture=neutral, PublicKeyToken=18CBAE0F9955702A, processorArchitecture=x86 using NationalInstruments.Common.Native, Version=8.9.35.302, Culture=neutral, PublicKeyToken=18cbae0f9955702a, processorArchitecture=x86.
      * [3/14/2012 10:17:17 AM] : Detecting dependent assembly NationalInstruments.Common, Version=8.6.35.131, Culture=neutral, PublicKeyToken=18CBAE0F9955702A, processorArchitecture=msil using NationalInstruments.Common, Version=8.9.35.302, Culture=neutral, PublicKeyToken=18cbae0f9955702a, processorArchitecture=msil.
      * [3/14/2012 10:17:17 AM] : Request of trust and detection of platform is complete.
  
  ERROR DETAILS
      Following errors were detected during this operation.
      * [3/14/2012 10:17:18 AM] 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>Thanks in advance,
  Joseph</p>
  <p>Edit: It seems the problem is spreading. On the second machine I purged all of the ClickOnce files in the &quot;Local Settings/Apps&quot; so I had to reinstall an old program. When I went to do so it gave me the same error. This program was last updated in February. In response I tried totally removing and reinstalling the .NET framework to no avail.</p>