TheSoftwareJedi
TheSoftwareJedi

Reputation: 35196

ClickOnce error: Value does not fall within the expected range

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. 

Upvotes: 62

Views: 63173

Answers (17)

B H
B H

Reputation: 1878

Another thing to try that is slightly less brute force than deleting the 2.0 folder under apps as suggested above. Latest build of a ClickOnce WPF app refuses to activate during a local install on one particular machine

Upvotes: 0

user2278084
user2278084

Reputation: 1

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.

Upvotes: 0

LLuis
LLuis

Reputation: 1

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

Upvotes: 0

Nayrb
Nayrb

Reputation: 1043

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.

Upvotes: 0

Ricky
Ricky

Reputation: 1777

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.

Upvotes: 1

Champukuta
Champukuta

Reputation: 51

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

Upvotes: 3

Jeffrey Mazza
Jeffrey Mazza

Reputation: 91

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

Upvotes: 9

AdamsTips
AdamsTips

Reputation: 1776

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!! :-)

Upvotes: 5

Binu Bhasuran
Binu Bhasuran

Reputation: 468

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.

Upvotes: 1

AJ AJ
AJ AJ

Reputation: 325

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.

Upvotes: 0

akw
akw

Reputation: 21

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.

Upvotes: 2

spud
spud

Reputation: 505

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

Upvotes: 28

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.

Upvotes: 0

Tony
Tony

Reputation: 17647

You can try this:

rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache

Upvotes: 50

Lynn
Lynn

Reputation: 1123

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

Upvotes: 12

Pierre Arnaud
Pierre Arnaud

Reputation: 10527

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.

Upvotes: 17

TheSoftwareJedi
TheSoftwareJedi

Reputation: 35196

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

Upvotes: 10

Related Questions