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

9

36

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

Outstay answered 5/8, 2011 at 12:53 Comment(0)
C
76

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.

Cutty answered 5/8, 2011 at 13:17 Comment(3)
I am unable to do so. See attached screenshot.Outstay
Properties window, not the Project + Properties dialog. Use View + Properties Window if necessary.Cutty
Ahhhhhhhhhhhhhhhh... Build: 13 succeeded or up-to-date, 0 failed, 0 skippedOutstay
F
26
  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.
Foreordain answered 18/1, 2012 at 19:17 Comment(3)
Worked for me too, magic! Thanks! I don't know why Microsoft was not notified about the importance of this simple and basic action...Analemma
I don't know why such a way. Is that a bug ?. ok but it worked. ThanksOverline
Or click install project and there in properties change TargetPlatform to x64.Settera
L
10
  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

Ligature answered 3/2, 2018 at 19:40 Comment(0)
R
7
  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.
Retroact answered 21/12, 2011 at 10:59 Comment(0)
D
4

This is because of the TargetPlatform.

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

enter image description here

Debroahdebs answered 31/10, 2020 at 6:56 Comment(0)
S
1
  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.

Sapphirine answered 2/2, 2017 at 14:23 Comment(0)
A
0

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.

Amadeo answered 2/4, 2013 at 14:58 Comment(0)
S
0

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

Stem answered 3/5, 2018 at 7:30 Comment(0)
G
0

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

Gibraltar answered 31/5, 2018 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.