.net ClickOnce 错误:值不在预期范围内
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1166233/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ClickOnce error: Value does not fall within the expected range
提问by TheSoftwareJedi
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).
在为某个用户启动的 ALL ClickOnce 应用程序上出现此错误。这在版本升级后开始发生(但没有其他人发生)。
I've tried subsequently changing the version number, add/remove, registry scrub, clearing Local Settings\Apps folder, etc... Still no luck.
我随后尝试更改版本号、添加/删除、注册表清理、清除本地设置\应用程序文件夹等......仍然没有运气。
This articlepoints 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.
采纳答案by TheSoftwareJedi
The problem mysteriously disappeared after repeatedly deleting that folder, and attempting to reinstall. Perhaps there was a reboot thrown in there too.
在反复删除该文件夹并尝试重新安装后,问题神秘地消失了。也许那里也有重启。
回答by Tony
You can try this:
你可以试试这个:
rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache
回答by spud
I un-installed the application from Control Panel then re-installed which fixed the issue for me.
我从控制面板卸载了该应用程序,然后重新安装,这为我解决了这个问题。
回答by Pierre Arnaud
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.
我也在 Windows 7 x64 机器上遇到过这个错误。我终于能够通过完全删除注册表中的任何引用(但这还不够)然后清除%user%\AppData\Local\Apps.
回答by Lynn
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
我意识到这是一个老问题,但我偶然发现了同样的问题并找到了不同的解决方案:原因是 ClickOnce 网络安装路径中的“&”。Microsoft 已确认此问题并表示他们不会修复它:Microsoft 错误报告
回答by Jeffrey Mazza
Simple fix steps:
简单的修复步骤:
1) uninstall from control panel
1)从控制面板卸载
2) delete "2.0"folder located in %user%\AppData\Local\Apps.
You should now be able to re-install
2) 删除"2.0"位于%user%\AppData\Local\Apps. 您现在应该可以重新安装
回答by AdamsTips
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 driveinstead 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:
在对这个错误进行了数小时的故障排除后,我发现在我的情况下,这是因为我试图从映射的网络驱动器而不是UNC 路径运行安装程序。第一次运行安装程序时,它工作正常。但是如果你再次运行它,你会得到以下错误:
Browsing into the error details, you find the highly ambiguous error:
浏览错误详细信息,您会发现高度模糊的错误:
If I instead run the application from a UNC path \\MyServer\MyShare\Deploy...Then it runs just fine, consistently.
如果我改为从 UNC 路径运行应用程序,\\MyServer\MyShare\Deploy...那么它运行得很好,始终如一。
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 *.applicationdeployment manifest.
经过进一步调查,听起来这里发生的事情是安装程序正在验证(出于安全原因)它是从授权部署 url 运行的,如*.application部署清单中指定的那样。
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:
由于当前路径(映射驱动器)与UNC路径不同,安装失败,程序被删除。注意错误日志中路径的区别:
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."
因此,错误的真正含义是“警告!无法安装应用程序,因为部署 URL 与部署清单中指定的提供程序 URL 不匹配。”
Well, that would have saved me a lot of hours of troubleshooting!! :-)
好吧,那可以为我节省大量的故障排除时间!!:-)
回答by akw
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.
检查参考是否有 Copy Local= true。例如,我的问题是真实的 Office 参考。当它试图复制它时,发生了冲突,因此无法打开该程序。希望这能解决您的问题。
回答by Binu Bhasuran
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.
如果您遇到此问题以进行以下更新检查。
- Download application.exe.manifestfile from the deployment which is working.
- Compare current version of application.exe.manifestfile with old one.
- 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.
- 从正在运行的部署中下载application.exe.manifest文件。
- 将application.exe.manifest文件的当前版本与旧版本进行比较。
- 查找添加/删除/更改的任何参考。如果您看到任何可疑内容,请手动编辑/回滚清单的该部分并尝试,大多数情况下它会起作用。
If new Upload
如果新上传
Check you have all assemblies marked as 'copy local=true'got in deployment folder, also check its size once uploaded.
检查您是否在部署文件夹中获得了所有标记为“copy local=true”的程序集,并在上传后检查其大小。
because 'copy local = false'assemblies will be treated as prerequisites in clickonce engine. Most of the application launch problem starts from there.
因为“ copy local = false”程序集将被视为 clickonce 引擎中的先决条件。大多数应用程序启动问题都是从那里开始的。
回答by Champukuta
Deleted everything in %user%\AppData\Local\Apps\2.0\and it worked.
删除了所有内容%user%\AppData\Local\Apps\2.0\并且它起作用了。


