我有一个共享给大约 30 台不同计算机(32 位和 64 位机器的混合)的 .NET 应用程序。
编译时,应用程序设置为目标“任何 CPU”。
除了 Windows 7 64 位之外,它在所有机器上都运行良好。
错误信息是:
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
经过研究,我发现如果我将 objective-c PU更改为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)
最佳答案
在 MSDN 论坛上发现的一个高度相关的主题是 ClickOnce Fails with "Value does not fall within the expected range."
关于.net - 启动编译为目标 'Any CPU' 的 .NET 应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7980773/