Unable to compile vdproj with devenv - 'targeting 'x64' is not compatible with the project's target platform 'x86''

淺唱寂寞╮ 提交于 2019-11-30 04:35:24
Hans Passant

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.

  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.
  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.
Hafizur Rahman Shaik
  1. Go to Visual Studio "View" menu and click Properties Windows:

  1. Select Target Framework x64 bit:

Shailendra
  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.

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.

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

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........

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!