2

I am trying to deploy a ClickOnce app. It had worked previously when the server was just sitting with .Net 2.0 installed (no SP). Recently the server had 3.5SP1 installed on it and now ClickOnce is failing with the error:

Value does not fall within the expected range inside System.Deployment.

Here is the information posted on the MSDN forums (answers there are generally hit or miss for me) with the call stack:

It was in VS 2005 w/SP1 and I tried changing the path I publish to, changing the installation URL, changing the assembly name, manually controlling versions, running mage -cc, manually removing all application data in %userprofile%\AppData\Local\Apps and even changing deployment servers completely but still get the same error:

ERROR DETAILS Following errors were detected during this operation. * [3/30/2009 5:35:37 PM] 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& 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& 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)

Any help at all would be much appreciated..

The referenced forum is here

Scott Salyer
  • 2,165
  • 7
  • 45
  • 82
  • The previous versions are on the publish folder? have you a clickOnce key lost? – Jhonny D. Cano -Leftware- Mar 30 '09 at 21:53
  • I'm not sure what you mean by a ClickOnce Key lost? The previous versions were on the server but then I tried moving it to a new path and then even a new server altogether and the same error persists no matter what. – Scott Salyer Mar 31 '09 at 14:00

5 Answers5

3

I had a similar problem.

The solution for me was that ClickOnce craps out if there is an ampersand in the publish path. Being as I was publishing to the folder for our Research and Development department, i.e. "\serverName\r&d\", this was causing me grief, and was giving me the same uncommunicative "Value does not fall within the expected range" that you are seeing.

I don't know if that will solve your problem, but I feel obliged to suggest it.

Frosty840
  • 7,965
  • 12
  • 50
  • 86
  • Just wanted to add that through Googling I found this thread as I was having the same problem and ClickOnce was bombing out for me because the install directory had an ampersand in it. Very annoying but at least I know what it is now. – Tom Oct 26 '10 at 13:09
2

In the end my only way of resolving the issue was to create an entirely new project and copy the code over from each form and then publish that.

Jonez: Unfortunately moving my user profile would have been a major hassle and it seemed to me that this would've been major overkill to fix a publishing issue.

Gregory: The installation would fail with that error. I tried publishing to a new location (different physical server) and the issue was still present and I confirmed no ampersands were used in either path.

Scott Salyer
  • 2,165
  • 7
  • 45
  • 82
1

I just ran into this error and was able to resolve it by simply uninstalling then reinstalling the application on the user's computer.

Brian
  • 4,001
  • 4
  • 22
  • 28
1

If you're looking for a quick and dirty solution that works 95% of the time for System.Deployment issues, remove and create a new user profile. Be sure to back up any valuable data before doing this, such as the desktop, favorites, "My Documents, "My Pictures", Outlook files, etc.

I've also seen people delete the entire Local Settings directory to fix issues. Note that this directory sometimes contains Outlook .pst files.

Be cognizant that you may be effecting other applications by performing these fixes and that the effects are sometimes irrevisible. These solutions are obviously not ideal, but these are the solutions that Microsoft has provided me.

Good luck.

James Jones
  • 8,653
  • 6
  • 34
  • 46
  • This is purely speculation, but I'm pretty confident that deleting the entire user profile is effective because it causes some sort of "reset" in the registry, and I believe that many aspects of System.Deployment are tied to user profile info in the registry. – James Jones Apr 03 '09 at 16:49
  • In rare cases, resetting Windows Regional Settings has corrected deployment issues. Do this by toggling the regional settings in the control panel, hitting "Apply" between each toggle. – James Jones Apr 03 '09 at 16:51
0

Have you changed the target platform for the application itself? More importantly, does your development machine have .NET 3.5 SP-1 installed on it?

This error occurs when you have mismatched references. So your deployment expects one version, but the machine it's being installed on has a different version. It also happens if you have circular references.

Sampson
  • 265,109
  • 74
  • 539
  • 565
RobinDotNet
  • 11,723
  • 3
  • 30
  • 33