Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File targeting 'AMD64' is not compatible with project's target platform 'x86'

I'm trying to create an installation from scratch using Visual Studio 2019 for a old project (it builds) Every time I try to build, I get the

Error: WARNING: File ' something.dll' targeting 'x64' is not compatible with the project's target platform 'x86'.

I am able to use VS2019 to build the old project though. how can I take to resolve this problem?

screenshot

like image 339
lishiyu Avatar asked Sep 17 '25 02:09

lishiyu


2 Answers

Resolution:

  • When building your setup package you need to target a specific target platform: x86, x64, or Itanium.
  • Select your setup project in the Solution Explorer, then open the Properties Window (View > Properties Window)
  • Change the TargetPlatform to match the Platform target you set for your WinForm application (see screenshot below).

Source https://userapps.support.sap.com/sap/support/knowledge/en/1548930

like image 84
KA-Yasso Avatar answered Sep 19 '25 09:09

KA-Yasso


You need to be targeting 64-bit (x64 / AMD64) platform for your project build, as one of your components - something.dll - is 64-bit.

To configure a project to target a 64-bit platform

On the menu bar, choose Build > Configuration Manager.

In the Active solution platform list, choose a 64-bit platform for the solution to target, and then choose the Close button.

More details https://learn.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022

like image 34
Mike Irving Avatar answered Sep 19 '25 10:09

Mike Irving