启动编译为目标“任何 CPU”的 .NET 应用程序时出错

发布于 2024-12-13 04:54:43 字数 1915 浏览 1 评论 0原文

我有一个 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄兵必败 2024-12-20 04:54:43

在 MSDN 论坛上找到的高度相关的线程是 ClickOnce 失败,并显示“值不在预期范围内。”

A highly relevant thread found on MSDN forum is ClickOnce Fails with "Value does not fall within the expected range."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文