Sarah Weinberger
Sarah Weinberger

Reputation: 15571

Targeting x86 & x64 assemblies from the same VS2012 project; references

I have a Visual Studio 2012 .Net project for which I would like to create both 32-bit (x86) and 64-bit (x64) using the same solution and project, just different configurations.

I already created the four different configuration/builds (Debug, Release, Debug64, and Release64). I went to the project properties and set in the build tab the proper processor and build location.

My problem deals in how to handle the references.

For instance, I am using ChilkatDotNet45, which ships with both 32-bit and 64-bit versions. The same DLL name, not that that matters. The x86 build requires the 32-bit version of my 3rd party assemblies, such as those from Chilkat, and the x64-bit version requires the 64-bit versions of those same assemblies.

I tried adding both DLL assemblies to the references, but VS2012 refused to allow the second one saying that the assembly already exists.

I did read the other stackoverflow posting that talks a bit about targeting both processor versions, but I did not see, at least clearly, how to handle the references. Targeting both 32bit and 64bit with Visual Studio in same solution/project

I have several 3rd party assemblies that ship with 32-bit and 64-bit. How do I handle the references?

Upvotes: 3

Views: 2571

Answers (2)

Sarah Weinberger
Sarah Weinberger

Reputation: 15571

I combined the responses in

Conditionally use 32/64 bit reference when building in Visual Studio

to find the solution. I had to use platform as the conditional test.

Upvotes: 2

UsmanAzam
UsmanAzam

Reputation: 549

Try to change the project type to AnyCPU

Upvotes: -1

Related Questions