2
votes

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

5
The previous versions are on the publish folder? have you a clickOnce key lost?Jhonny D. Cano -Leftware-
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

5 Answers

3
votes

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.

2
votes

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.

1
votes

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.

1
votes

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

0
votes

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.