62

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. 
TheSoftwareJedi
  • 34,421
  • 21
  • 109
  • 151

16 Answers16

50

You can try this:

rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
Tony
  • 16,527
  • 15
  • 80
  • 134
  • 6
    nice one. Could you add an explanation as to what this line actually does? – DigCamara Jul 21 '14 at 18:13
  • 2
    Years later and it worked for me. Silly that this is still a problem. – dya Apr 17 '18 at 01:51
  • 2
    Didn't work for me on Windows 7. Microsoft should already fix these problems with click-once applications, it's making our applications and us developers look bad! I constantly need to uninstall and reinstall my applications, clients constantly complain about application not running! Maybe I should make my own update. It's shameful that Microsoft allows this crap constantly happening. – Hrvoje Batrnek Jul 11 '18 at 06:53
  • This solution worked for me. I don't really understand the error message though. – Gary Nov 13 '18 at 14:00
  • M$ = pain in the a$$ – denny Dec 13 '22 at 15:18
27

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

spud
  • 495
  • 5
  • 10
  • 1
    Ugh, this workaround worked for me as well. Damned ClickOnce. :( – Richard Ev Feb 16 '15 at 19:35
  • This happens intermittently with our apps and un-install and re-install is the fastest way to resolve it - luckily all the settings are held on our servers so minimal disruption, other than they always forget their user name :-) – gchq Nov 17 '15 at 15:39
16

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.

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
12

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

Lynn
  • 1,103
  • 15
  • 29
  • 1
    Lynn, the link you've mentioned above doesn't exist anymore. Is there any other link where Microsoft has confirmed this issue? – Sandeep May 24 '13 at 05:44
  • 1
    @Sandeep - That issue seems to have been deleted. I tried searching for it and could not find it now. All I know is it existed when I gave that answer ages ago and its status was "Won't Fix". – Lynn May 24 '13 at 06:54
  • Very interesting. I do in fact have an `&` in my path but it nearly always installs correctly. Just once in a while fails. I usually revert back to previous version and then create a new version – Simon_Weaver Mar 17 '15 at 22:43
  • 2
    2017... still an issue. Fixed my problem. – Justin Conroy Jan 10 '17 at 12:41
  • 1
    I too had an & in my install Path. Copy the Folder Locally to the machine I was Installing it on and it all worked well. VS Enterprise 2015 – scooter133 Aug 07 '17 at 21:16
10

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

TheSoftwareJedi
  • 34,421
  • 21
  • 109
  • 151
7

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

Prashanth Benny
  • 1,523
  • 21
  • 33
Jeffrey Mazza
  • 71
  • 1
  • 2
4

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

AdamsTips
  • 1,648
  • 17
  • 22
2

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.

Jonathan
  • 7,349
  • 5
  • 29
  • 35
akw
  • 21
  • 1
2

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

Frits
  • 7,341
  • 10
  • 42
  • 60
Champukuta
  • 31
  • 1
1

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.

Binu Bhasuran
  • 468
  • 1
  • 4
  • 9
1

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.

Ricky
  • 1,587
  • 2
  • 12
  • 20
0

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.

AJ AJ
  • 187
  • 2
  • 12
0

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.

0

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.

Bryan Harrington
  • 991
  • 2
  • 17
  • 31
0

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

LLuis
  • 1
0

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.