启动编译为目标“任何 CPU”的 .NET 应用程序时出错
我有一个 .NET 应用程序,它共享给大约 30 台不同的计算机(32 位和 64 位计算机的混合)。
编译时,应用程序设置为目标“任何 CPU”。
它在除 Windows 7 64 位之外的所有计算机上运行良好。
错误信息是:
在此操作期间检测到以下错误。 * [11/2/2011 8:59:40 AM] System.ArgumentException - 值未落在预期范围内。 - 来源:System.Deployment
经过研究,我发现如果我将目标 CPU 更改为 64 位,它可以在有问题的计算机上运行良好,但无法在 32 位计算机上运行。
有解决办法吗?
堆栈跟踪:
- Stack trace:
at System.Deployment.Internal.Isolation.IStore.LockApplicationPath(UInt32 Flags, IDefinitionAppId ApId, IntPtr& Cookie)
at System.Deployment.Application.ComponentStore.LockApplicationPath(DefinitionAppId definitionAppId)
at System.Deployment.Application.SubscriptionStore.LockApplicationPath(DefinitionAppId definitionAppId)
at System.Deployment.Application.FileDownloader.PatchFiles(SubscriptionState subState)
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
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)
I have a .NET application that is shared to around 30 different computers, (mix of 32-bit and 64-bit machines).
When compiled, the application is set to target 'Any CPU'.
It runs fine on all machines except one that is Windows 7 64 bit.
The error message is:
Following errors were detected during this operation. * [11/2/2011
8:59:40 AM] System.ArgumentException
- Value does not fall within the expected range.
- Source: System.Deployment
After researching, I found that if I change the target CPU to 64-bit it runs fine on the problem machine, but will not run on the 32-bit computers.
Is there a fix for this?
Stack trace:
- Stack trace:
at System.Deployment.Internal.Isolation.IStore.LockApplicationPath(UInt32 Flags, IDefinitionAppId ApId, IntPtr& Cookie)
at System.Deployment.Application.ComponentStore.LockApplicationPath(DefinitionAppId definitionAppId)
at System.Deployment.Application.SubscriptionStore.LockApplicationPath(DefinitionAppId definitionAppId)
at System.Deployment.Application.FileDownloader.PatchFiles(SubscriptionState subState)
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 MSDN 论坛上找到的高度相关的线程是 ClickOnce 失败,并显示“值不在预期范围内。”
A highly relevant thread found on MSDN forum is ClickOnce Fails with "Value does not fall within the expected range."