代码之家  ›  专栏  ›  技术社区  ›  TheSoftwareJedi jac

ClickOnce错误:值不在预期范围内

  •  50
  • TheSoftwareJedi jac  · 技术社区  · 15 年前

    在为某个用户启动所有ClickOnce应用程序时出现此错误。这在版本升级后开始发生(但其他人不会发生)。

    我随后尝试更改版本号、添加/删除、注册表清理、清除本地设置\应用程序文件夹等。。。还是不走运。

    This article

     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. 
    
    13 回复  |  直到 15 年前
        1
  •  49
  •   Tony    13 年前

    您可以尝试以下方法:

    rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
    
        2
  •  26
  •   spud    12 年前

        3
  •  14
  •   Pierre Arnaud    14 年前

    我在Windows7x64机器上也遇到了这个错误。通过完全删除注册表中对的任何引用(但这还不够),然后清除,我终于能够正确安装ClickOnce应用程序 %user%\AppData\Local\Apps .

        4
  •  10
  •   Lynn    14 年前

    我意识到这是一个老问题,但我偶然发现了相同的问题并找到了不同的解决方案:原因是ClickOnce网络安装路径中的“&”。Microsoft已确认此问题,并声明不会解决此问题: Microsoft Bug Report

        5
  •  9
  •   TheSoftwareJedi jac    15 年前

    在反复删除该文件夹并尝试重新安装后,问题神秘地消失了。也许那里也出现了重启。

        6
  •  6
  •   Prashanth Benny    8 年前

    2) 删除 "2.0" %user%\AppData\Local\Apps . 您现在应该可以重新安装

        7
  •  3
  •   AdamsTips    8 年前

    在对这个错误进行了几个小时的故障排除之后,我发现在我的例子中,这是因为我试图从一个服务器上运行安装程序 映射网络驱动器 而不是 UNC路径

    Cannot Start Application

    浏览错误详细信息,您会发现高度不明确的错误:

    enter image description here

    如果我改为从UNC路径运行应用程序 \\MyServer\MyShare\Deploy... 然后它运行得很好,始终如一。

    经过进一步调查,这里的情况似乎是安装程序正在验证(出于安全原因)它是否正在从授权部署url运行,如 *.application 部署清单。

    enter image description here

    由于当前路径(映射驱动器)与UNC路径不同,因此安装失败,程序被删除。请注意错误日志中路径之间的差异:

    enter image description here

    “警告!无法安装应用程序,因为部署URL与部署清单中指定的提供程序URL不匹配。”

    好吧,那会节省我很多时间的故障排除!!:-)

        8
  •  2
  •   Jonathan    10 年前

    我解决了我的例外

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

    Local= true . 例如,我的问题是关于true的Office参考。当它试图复制它时,发生了冲突,因此无法打开程序。希望这能解决你的问题。

        9
  •  1
  •   Binu Bhasuran    8 年前

    我一直在为这个问题寻找一个干净的解决方案。我可以通过反复试验来修复它几次。最后,我终于能够确定确切的问题。我想在这里分享。

    上面的错误说明它在部署文件夹中找不到匹配的文件。

    如果您面临此问题,请执行以下更新检查。

    1. 下载 application.exe.manifest 工作。
    2. 比较当前版本的 application.exe.manifest 用旧的。
    3. 查找添加/删除/更改的任何参考。如果 如果发现任何可疑信息,请手动编辑/回滚该部分 显示并尝试,在大多数情况下它都会起作用。

    如果新上传

    检查是否已将所有程序集标记为 已进入部署文件夹,并在上载后检查其大小。

    复制本地=假' 在clickonce引擎中,程序集将被视为先决条件。大多数应用程序启动问题都是从这里开始的。

        10
  •  1
  •   Frits vijay Ingale    7 年前

    删除了中的所有内容 %user%\AppData\Local\Apps\2.0\ 它成功了。

        11
  •  0
  •   Tim Cooper    13 年前

        12
  •  0
  •   AJ AJ    8 年前

    我的问题是由csproj文件中的更改引起的。 对程序集的引用已从以下位置更改:

    HintPath> .. \

    它在清单文件中添加了依赖项xml元素。

    编辑csproj文件并发布,修复了清单文件。

        13
  •  0
  •   Ricky    7 年前

    我们已经多次处理过这个错误,但今天它停止了一切,给我们带来了巨大的问题。我想不出来。我在微软打开了一个关键的支持案例,在我们的第一个电话中,通过阅读错误日志,我找到了答案。

    我的解决方案有几个项目。我们的主程序是一个,然后有一个公共dll。我更改了Excel(Microsoft.Office.Interop.Excel)的公共dll中的引用,从版本12开始,由于调试和框架兼容性方面的其他问题,我将其升级到v15。我做了一些工作之后就放了。

    发布后我注意到,我还没有升级主项目中的Excel dll,因为它也有一些引用。好吧,即使我升级到v15,问题仍然存在。那是我打电话给微软的时候。

    在我们第一次打电话之后,我注意到当应用程序启动失败时,错误日志中有几行。

    * [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.
    

    注意中间一行是如何显示12.0.0.0版的?嗯,我很困惑。所以我开始寻找其他的办公室推荐人。我发现我们的主程序只引用了Office.dll和Interop.Word dll。我删除了它们并读取了对v15的interop dll的引用,然后我再次发布了这个应用程序。

    它仍然不起作用,但只要我卸载了应用程序,然后重新安装,一切都很好。在我修复问题后,尚未升级的人在升级时没有问题。试图升级的人必须卸载并重新安装。

    希望这对其他人有帮助。

        14
  •  0
  •   Bryan Harrington    6 年前

    我有一个客户正在安装我们的VSTO插件MSI,我们看到了这一点。

    System.ArgumentException:值不在预期范围内。位于System.Deployment.Internal.IsolationInterop.GetUserStore(UInt32标志、IntPtr hToken、Guid和riid)

        15
  •  0
  •   LLuis    5 年前

    我尝试了一个简单的配置。去医院 项目->房地产->应用程序->

    选中图标和mainfest,选择选项旁边的图标 使用默认配置嵌入清单

        16
  •  0
  •   user2278084    4 年前