ClickOnce error: Value does not fall within the expected range

.NetClickonce

.Net Problem Overview


Getting this error on ALL ClickOnce application launches for a certain user. This started happening after a version upgrade (but happens to no one else).

I've tried subsequently changing the version number, add/remove, registry scrub, clearing Local Settings\Apps folder, etc... Still no luck.

This article points to a user profile corruption, but I recreating this user isn't an option. Are there any other ideas on cleaning this up?

 PLATFORM VERSION INFO
	Windows 			: 5.1.2600.196608 (Win32NT)
	Common Language Runtime 	: 2.0.50727.3082
	System.Deployment.dll 		: 2.0.50727.3053 (netfxsp.050727-3000)
	mscorwks.dll 			: 2.0.50727.3082 (QFE.050727-3000)
	dfdll.dll 			: 2.0.50727.3053 (netfxsp.050727-3000)
	dfshim.dll 			: 2.0.50727.3053 (netfxsp.050727-3000)

SOURCES
	Deployment url			: file:///C:/Documents%20and%20Settings/<username>/Start%20Menu/Programs/<programname>/<programname>.appref-ms%7C

ERROR SUMMARY
	Below is a summary of the errors, details of these errors are listed later in the log.
	* Activation of \\NDP13\C\Documents and Settings\<username>\Start Menu\Programs\<programname>\<programname>.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
	* [7/22/2009 10:35:30 AM] : Activation of \\NDP13\C\Documents and Settings\<username>\Start Menu\Programs\<programname>\<programname>.appref-ms| has started.

ERROR DETAILS
	Following errors were detected during this operation.
	* [7/22/2009 10:35:30 AM] System.ArgumentException
		- Value does not fall within the expected range.
		- Source: System.Deployment
		- Stack trace:
			at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)
			at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore()
			at System.Deployment.Application.ComponentStore..ctor(ComponentStoreType storeType, SubscriptionStore subStore)
			at System.Deployment.Application.SubscriptionStore..ctor(String deployPath, String tempPath, ComponentStoreType storeType)
			at System.Deployment.Application.SubscriptionStore.get_CurrentUser()
			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)

COMPONENT STORE TRANSACTION DETAILS
	No transaction information is available. 

.Net Solutions


Solution 1 - .Net

You can try this:

rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache

Solution 2 - .Net

I un-installed the application from Control Panel then re-installed which fixed the issue for me.

Solution 3 - .Net

I have also come across this error on a Windows 7 x64 machine. I've finally been able to properly install my ClickOnce application by completely removing any references to in the registry (but that was not enough) and then clearing %user%\AppData\Local\Apps.

Solution 4 - .Net

The problem mysteriously disappeared after repeatedly deleting that folder, and attempting to reinstall. Perhaps there was a reboot thrown in there too.

Solution 5 - .Net

I realize this is an old question but I stumbled upon the same problem and found a different solution: The cause was an "&" in the ClickOnce network install path. Microsoft has confirmed this issue and stated they will not fix it: Microsoft Bug Report

Solution 6 - .Net

Simple fix steps:

  1. uninstall from control panel

  2. delete "2.0" folder located in %user%\AppData\Local\Apps. You should now be able to re-install

Solution 7 - .Net

After hours of troubleshooting this error, I found that in my case it was because I was trying to run the installer from a mapped network drive instead of a UNC path. The first time you run the installer, it works fine. But if you run it again, you get the following error:

Cannot Start Application

Browsing into the error details, you find the highly ambiguous error:

enter image description here

If I instead run the application from a UNC path \\MyServer\MyShare\Deploy... Then it runs just fine, consistently.

Upon further investigation, it sounds like what is going on here is that the installer is verifying (for security reasons) that it is being run from the authorized deployment url, as specified in the *.application deployment manifest.

enter image description here

Since the current path (mapped drive) is different from the UNC path, the installation fails and the program is removed. Note the difference between the paths in the error log:

enter image description here

So what the error really means is "Warning! The application cannot be installed because the deployment URL does not match the provider URL specified in the deployment manifest."

Well, that would have saved me a lot of hours of troubleshooting!! :-)

Solution 8 - .Net

I solved my exception

System.ArgumentException
	- Value does not fall within the expected range.
	- Source: System.Deployment

Check if the reference has Copy Local= true . For example , my problem was Office reference on true. When it tried to copy it , a conflict occurred, so it couldn't open the program. Hope this solves your problem.

Solution 9 - .Net

Deleted everything in %user%\AppData\Local\Apps\2.0\ and it worked.

Solution 10 - .Net

i have been searching for a clean solution for this problem for a while. I could fix it couple of times by trial and error. Finally i could able to nail down exact issue. I thought of sharing it here.

Above error tells it can't find a matching file in deployment folder.

If you are facing this problem for an update check following.

  1. Download application.exe.manifest file from the deployment which is working.
  2. Compare current version of application.exe.manifest file with old one.
  3. Look for any reference added/removed/changed. if you see anything suspicious, manually edit/rollback that part of manifest and try, most cases it will work.

If new Upload

Check you have all assemblies marked as 'copy local=true' got in deployment folder, also check its size once uploaded.

because 'copy local = false' assemblies will be treated as prerequisites in clickonce engine. Most of the application launch problem starts from there.

Solution 11 - .Net

Curiously, I had the same issue and it was resolved by simply logging in as another user and installing/running the app. When I logged out and then logged in as the original user it all worked again.

Solution 12 - .Net

My problem was caused by a change in the csproj file. a reference to an assembly was changed from:

> HintPath>..\Files\

to

> HintPath> .. \ > ..\Files\

which added a dependency xml element in the manifest file.

editing the csproj file and publishing, fixed the manifest file.

Solution 13 - .Net

Have dealt with this error many times, but today it stopped everything and caused us huge issues. I could not figure it out. I opened a critical support case with Microsoft, and in our first phone call, reading through the error log, I figured it out.

My solution has several projects. Our main program is one, and then there's a common dll. I changed a reference in the common dll for Excel (Microsoft.Office.Interop.Excel) from version 12, and upgraded to v15 due to other issues with debugging and framework compatibility. I then released after doing some work.

What I noticed after release was that I had not upgraded the Excel dll in my main project also, as it has a few references to it also. Well, even after I upgraded that to v15, the problem still existed. That's when I called microsoft.

After our first phone call, I noticed a couple lines in the error log when the app start fails.

* [3/12/2018 2:10:57 PM] : Detecting dependent assembly Microsoft.Vbe.Interop, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C, processorArchitecture=msil using Microsoft.Vbe.Interop, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=msil.
* [3/12/2018 2:10:57 PM] : Detecting dependent assembly office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C using office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c.
* [3/12/2018 2:10:57 PM] : Detecting dependent assembly office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C, processorArchitecture=msil using office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=msil.

Notice how the middle line shows Version 12.0.0.0? Well, I was confused. So I started looking for any other office references. I found that our main program made a reference to just Office.dll, and the Interop.Word dll. I removed them and readded the reference to the Word interop dll of v15, then I released the app again.

It still didn't work, but as soon as I uninstalled the application then reinstalled, all was good. People who had not yet upgraded had no issue upgrading once I had fixed the issue. The people who had tried to upgrade had to uninstall and reinstall.

Thankfully, Microsoft closed the case without any charges :)

Hope this helps someone else.

Solution 14 - .Net

I was having a customer installing our VSTO addin MSI and we were seeing this.

System.ArgumentException: Value does not fall within the expected range. at System.Deployment.Internal.Isolation.IsolationInterop.GetUserStore(UInt32 Flags, IntPtr hToken, Guid& riid)

After checking their Event logs it was clear to me that they were having issues with thier user profile. They rebuild their user profile and it fixed the issue.

Solution 15 - .Net

I tried a simple configuration. Go to the project -> properties -> application ->

check the icon and mainfest, select an icon next to the option embed manifest with the default configuration

good luck

Solution 16 - .Net

I came across this problem installing on a new Win 10 build. Changed target framework from .NET Framework 2.0 to .NET Framework 4.5 and problem is resolved.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTheSoftwareJediView Question on Stackoverflow
Solution 1 - .NetTonyView Answer on Stackoverflow
Solution 2 - .NetspudView Answer on Stackoverflow
Solution 3 - .NetPierre ArnaudView Answer on Stackoverflow
Solution 4 - .NetTheSoftwareJediView Answer on Stackoverflow
Solution 5 - .NetLynnView Answer on Stackoverflow
Solution 6 - .NetJeffrey MazzaView Answer on Stackoverflow
Solution 7 - .NetAdamsTipsView Answer on Stackoverflow
Solution 8 - .NetakwView Answer on Stackoverflow
Solution 9 - .NetChampukutaView Answer on Stackoverflow
Solution 10 - .NetBinu BhasuranView Answer on Stackoverflow
Solution 11 - .NetThe Triffid CollectiveView Answer on Stackoverflow
Solution 12 - .NetAJ AJView Answer on Stackoverflow
Solution 13 - .NetRickyView Answer on Stackoverflow
Solution 14 - .NetBryan HarringtonView Answer on Stackoverflow
Solution 15 - .NetLLuisView Answer on Stackoverflow
Solution 16 - .Netuser2278084View Answer on Stackoverflow