无法使用 devenv 编译 vdproj - 'targeting 'x64'与项目的目标平台“x86”不兼容;

发布于 2024-11-28 02:59:44 字数 3814 浏览 1 评论 0原文

过去几个小时我一直在网上搜索,找到了很多与我的问题相关的信息 - 但没有一个真正解决它们。

我的机器是 64 位,安装了 32 位 Visual Studio 10。 解决方案使用.Net 4。 解决方案包括 Crystal Reports 的 64 位安装。 解决方案还包括 log4net。

在 VS2010 中编译项目对于任何 cpu 的 Debug 和 Release 都是可以的。

我添加了一个我想要构建的 Web 安装项目。 但是,无论配置如何,我在编译时都会遇到以下错误(在 VS UI 中和使用 devenv.exe 的命令行中):

ERROR: File 'CrystalDecisions.ReportAppServer.Prompting.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.Prompting.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ObjectFactory.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ObjectFactory.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.XmlSerialize.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.XmlSerialize.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommonObjectModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommonObjectModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommonControls.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommonControls.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ReportDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ReportDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'log4net.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.Controllers.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.Controllers.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.DataDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.DataDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CubeDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CubeDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ClientDoc.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ClientDoc.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommLayer.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommLayer.dll' targeting 'x64' is not compatible with the project's target platform 'x86'

我尝试将项目的配置显式设置为 x86 和 x64,而不进行任何更改。

有人可以指导我正确的方法吗?

编辑 - 添加的屏幕截图显示我无法为安装项目选择平台。

在此处输入图像描述

I've been searching around the web for the past hours, finding a lot of information related to my problem - but none actually fixing them.

My machine is 64 bit with a 32 bit Visual Studio 10 installed.
Solution uses .Net 4.
Solution includes 64 bits installation of Crystal Reports.
Solution also includes log4net.

Compilation of project in VS2010 is OK for both Debug and Release, any cpu.

I have added a Web Setup Project that I want to build.
However, no matter the configuration I get the following errors when compiling (both within VS UI and command line using devenv.exe):

ERROR: File 'CrystalDecisions.ReportAppServer.Prompting.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.Prompting.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ObjectFactory.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ObjectFactory.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.XmlSerialize.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.XmlSerialize.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommonObjectModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommonObjectModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommonControls.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommonControls.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ReportDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ReportDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'log4net.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.Controllers.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.Controllers.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.DataDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.DataDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CubeDefModel.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CubeDefModel.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.ClientDoc.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.ClientDoc.dll' targeting 'x64' is not compatible with the project's target platform 'x86'
ERROR: File 'CrystalDecisions.ReportAppServer.CommLayer.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'CrystalDecisions.ReportAppServer.CommLayer.dll' targeting 'x64' is not compatible with the project's target platform 'x86'

I have tried to explicitly set the configuration for the projects to both x86 and x64, without any change.

Can someone guide me on the right way?

Edit - added screenshot showing that I am unable to choose platform for the setup project.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(9

池木 2024-12-05 02:59:44

您必须将安装项目标记为 64 位安装程序。在“属性”窗口中将安装项目的 TargetPlatform 属性从 x86(默认值)更改为 x64。
另请确保部署 64 位版本的 log4net,并且 C# 项目的 TargetPlatform 设置为“任何 CPU”。
并确保您确实需要您的应用程序作为 64 位进程运行,这种情况很少见。

You have to mark the Setup project as a 64-bit installer. Your Setup project's TargetPlatform property in the Properties window, change it from x86 (the default) to x64.
Also make sure you deploy the 64-bit version of log4net and that your C# project's TargetPlatform setting is Any CPU.
And make sure that you actually need your app to run as a 64-bit process, that's rare.

无语# 2024-12-05 02:59:44
  1. 在记事本中打开 Deployment.vdproj。
  2. 查找字符串 "TargetPlatform" = "3:0"
  3. 对于 AMD64,更改为 "TargetPlatform" = "3:1",或者对于 Itanium,更改为 "TargetPlatform" = "3:2"。
  4. 保存 Deployment.vdproj。
    在 Visual Studio 中,您看不到任何更改,但您的项目现在是 AMD64。
  1. Open Deployment.vdproj, in Notepad.
  2. Find string "TargetPlatform" = "3:0"
  3. Change to "TargetPlatform" = "3:1" for AMD64, or "TargetPlatform" = "3:2" for Itanium.
  4. Save Deployment.vdproj.
    In Visual Studio you don't see any changes, but your Project now AMD64.
燕归巢 2024-12-05 02:59:44
  1. 转到 Visual Studio“查看”菜单并单击“属性”窗口:

在此处输入图像描述

  1. 选择目标框架 x64 位:

<图片src="https://i.sstatic.net/pqtuX.png" alt="在此处输入图像描述">

  1. Go to Visual Studio "View" menu and click Properties Windows:

enter image description here

  1. Select Target Framework x64 bit:

enter image description here

ま柒月 2024-12-05 02:59:44
  1. 打开部署项目。
  2. 在解决方案资源管理器中,选择部署项目。
  3. 在“属性”窗口中,选择 TargetPlatform 属性。
  4. 为 Intel Itanium 64 位平台选择 Itanium,或为任何其他 64 位平台(例如 AMD64 和 EM64T 指令集)选择 x64。
  5. 安装时,如果目标计算机与指定平台不兼容,则会出现错误并停止安装。
  1. Open a deployment project.
  2. In the Solution Explorer, select the deployment project.
  3. In the Properties window, select the TargetPlatform property.
  4. Choose either Itanium for an Intel Itanium 64-bit platform, or x64 for any other 64-bit platform (such as AMD64 and EM64T instruction sets).
  5. At installation time, an error will be raised and installation will be halted if the target computer is not compatible with the specified platform.
思念绕指尖 2024-12-05 02:59:44

这是因为 TargetPlatform

选择安装项目>属性并将 TargetPlatform 更改为 x64

在此处输入图像描述

This is because of the TargetPlatform.

select the setup project > properties and change the TargetPlatform to x64.

enter image description here

影子是时光的心 2024-12-05 02:59:44
  1. 打开部署项目。
  2. 在解决方案资源管理器中,选择部署项目。
  3. 在“属性”窗口中,选择 TargetPlatform 属性。
  4. 为 Intel Itanium 64 位平台选择 Itanium,或为任何其他 64 位平台(例如 AMD64 和 EM64T 指令集)选择 x64。

安装时,如果目标计算机与指定平台不兼容,则会出现错误并停止安装。

  1. Open a deployment project.
  2. In the Solution Explorer, select the deployment project.
  3. In the Properties window, select the TargetPlatform property.
  4. Choose either Itanium for an Intel Itanium 64-bit platform, or x64 for any other 64-bit platform (such as AMD64 and EM64T instruction sets).

At installation time, an error will be raised and installation will be halted if the target computer is not compatible with the specified platform.

栩栩如生 2024-12-05 02:59:44

您可能需要安装需要与 x86 应用程序通信的 x64 Windows 服务(例如 powershell)。您的回答(属性/目标平台)让我克服了这个障碍。

You may need an x64 Windows Service installed (think powershell) that needs to communicate to an x86 application. Your answer (properties/TargetPlatform) got me over that hurdle.

仅一夜美梦 2024-12-05 02:59:44

这是针对 Visual Studio 2010

转到您的项目 >右键单击并选择属性

在“编译”下,转到高级编译选项

找到目标 CPU,然后

32 位系统选择x86x64 适用于 64 位系统任何 CPU

This is for Visual Studio 2010

Go to your Project > Right Click and select Properties.

Under Compile, go to Advanced Compile Options

Locate Target CPU, then either

select x86 for 32bit systems, x64 for 64bit systems or Any CPU

始于初秋 2024-12-05 02:59:44

我的 .net 2010 项目都包含 x86 和 x64 安装项目。我的项目的目标平台是任何 CPU,每个安装项目都有正确的 - CPU 特定 - 目标平台。所有这些都是“基线”.Net 项目的一部分,当我开始开发时,我将其“克隆”(复制然后用记事本编辑多个文件)到新项目中。多年来一直运作良好。

我在新项目中遇到此错误,直到执行以下操作后才发现修复:

- Open Project Properties >> Compile >> Advanced and set Target to x86
- "Build" x86 Setup Project
    - Build Success
- Changed Project Properties >> Compile >> Advanced Target to x64
- "Build" x64 Setup Project
    - Build Success
- Changed Project Properties >> Compile >> Advanced Target to Any CPU
- Build x86 Setup Project
    - Build Success
- Build x64 Setup Project
    - Build Success

更改项目属性>>编译>>进阶到任何 CPU 以外的东西然后再回来似乎已经扭转了局面......

My .net 2010 Projects all include an x86 and an x64 Setup Project. The TargetPlatform for my Projects is Any CPU and each Setup Project has the correct - CPU Specific - TargetPlatform. All this is part of a "baseline" .Net Project that I "clone" (copy then edit several files with NOTEPAD) into a new Project when I start development. Has worked great for years.

I encountered this error in a new project and found no fix until I did the following:

- Open Project Properties >> Compile >> Advanced and set Target to x86
- "Build" x86 Setup Project
    - Build Success
- Changed Project Properties >> Compile >> Advanced Target to x64
- "Build" x64 Setup Project
    - Build Success
- Changed Project Properties >> Compile >> Advanced Target to Any CPU
- Build x86 Setup Project
    - Build Success
- Build x64 Setup Project
    - Build Success

Changing the Project Properties >> Compile >> Advanced to something other than Any CPU and back again seems to have turned the trick........

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