none
Setup project targetting x64 in VS2010 RRS feed

  • Question

  • I have an application that targets x64 computers. It runs fine on my computer but when I try to create a setup project I keep getting an error telling me

    Warning 2 File 'Basler.Pylon.dll' targeting 'x64' is not compatible with the project's target platform 'x86' 

    My problem is that there doesn't appear to be anyway to change the setup project's target. There are no options to change it like there are for the actual VB project. Reading the forum suggests that I missed something during the installation, but when I go to change /modify under control panel, it sure looks like everything is checked. Does anyone know how to solve this?

    If I "published" the project would I sidestep this issue

    Thursday, May 3, 2018 5:35 PM

All replies

  • Select the x64 Target CPU on the Visual Studio menu Project - Properties - Compile Tab (Visual Studio 2015 shown).

    Thursday, May 3, 2018 7:38 PM
  • Well the .Dll wouldn't run on non-x64 system apparently.

    And you can only compile to x64 on x64 system. Perhaps you need 2 versions of the .Dll, one for x86 and one for x64.


    La vida loca

    Thursday, May 3, 2018 8:04 PM
  • Yes, I'm developing on a 64 bit system and targeting a 64 bit system. There are both x64 and x86 versions of the dlls in question. Unfortunately, the references do not automatically update when you change target systems, which may be the problem. Is there a way to add both sets of references so it picks the correct ones? I think what happened is that the default target was anyCPU and that loaded the x86 references as they would run on any system.
    Thursday, May 3, 2018 8:57 PM
  • Well the first place that is looked for a .Dll is in the same location as the executable to my knowledge. So if the correct .Dll is in that location I don't believe the GAC is checked for the .Dll in question. I could be wrong about that though.

    See How the Runtime Locates Assemblies


    La vida loca

    Thursday, May 3, 2018 10:06 PM
  • Yes, I'm developing on a 64 bit system and targeting a 64 bit system. There are both x64 and x86 versions of the dlls in question. Unfortunately, the references do not automatically update when you change target systems, which may be the problem. Is there a way to add both sets of references so it picks the correct ones? I think what happened is that the default target was anyCPU and that loaded the x86 references as they would run on any system.

    No, you can't add both references. You need to chose x86 or x64, make sure the correct references are selected, and perform your setup build for each. You are supporting two different platforms so you need two different installs.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Friday, May 4, 2018 3:48 PM
  • I would like to get this conversation back on track. In VS2010 you do not see a form like that shown by tommytwotrain above for setup projects (every other project, yes, but setup projects no). I have not been able to find a spot to set the target of a setup project. All of the programs I am  trying to distribute run just fine on the development machine, (x64) no matter what the target is (x86, x64, anyCPU). If I set the solution (and hence everybody but the setup project to x64 then everything except the setup project compiles OK. The setup project, however, throws an error saying "...dll targeting "AMD64 is incompatible with the target (x86).  I don't see how to change the setup projects target and so don't know how to change this error.
    Monday, May 7, 2018 1:03 PM
  • I would like to get this conversation back on track. In VS2010 you do not see a form like that shown by tommytwotrain above for setup projects (every other project, yes, but setup projects no). I have not been able to find a spot to set the target of a setup project. All of the programs I am  trying to distribute run just fine on the development machine, (x64) no matter what the target is (x86, x64, anyCPU). If I set the solution (and hence everybody but the setup project to x64 then everything except the setup project compiles OK. The setup project, however, throws an error saying "...dll targeting "AMD64 is incompatible with the target (x86).  I don't see how to change the setup projects target and so don't know how to change this error.

    Oh, the Setup Program Setup you mean (Installer). Is it an MSI setup?

    I am not sure about your acesss case but there is a properties page for the MSI Project Setup. Select the MSI Project Setup in the Solution Explorer and then menu Project - Properties. Now you get a different type of dialog pop up. You can see there are lots of things to check have you looked at this? I am not sure what is required for your exact case.

    PS There is a Visual Studio Setup and Deployment forum you can also get more help on setup and deploy.


    Monday, May 7, 2018 1:50 PM
  • I would like to get this conversation back on track. In VS2010 you do not see a form like that shown by tommytwotrain above for setup projects (every other project, yes, but setup projects no). I have not been able to find a spot to set the target of a setup project. All of the programs I am  trying to distribute run just fine on the development machine, (x64) no matter what the target is (x86, x64, anyCPU). If I set the solution (and hence everybody but the setup project to x64 then everything except the setup project compiles OK. The setup project, however, throws an error saying "...dll targeting "AMD64 is incompatible with the target (x86).  I don't see how to change the setup projects target and so don't know how to change this error.

    Well once you get it figured out VS2017 Community is free at least for small entities I believe. Fortunately tommytwotrain is a developer of programs and probably has VS 2010 among other versions in order to assist you.

    Also you could ask for assistance in the Visual Studio General Questions Forum and maybe somebody there could help since this is project rather than VB.Net related.


    La vida loca

    Monday, May 7, 2018 11:27 PM