We use NuGet
to manage our third party packages.
We also have to build both an x86
and x64
builds.
We now have a dependency on a NuGet
package (zeromq
) that depends on a C dll and therefore has an x86
and x64
releases.
When searching in Nuget I only see two distinct projects (zeromq x64 and zeromq x86) and not one unified project.
Constraint
Our build process on the developers machines is to select the appropriate configuration(ie Debug/x86, Release x64, etc) in visual studio and build so any solution we use would have to fit into the visual studio GUI( ie MSBuild soltuions wouldn't' really fit our current workflow).
EDIT
Addendum to the constraint....If we can't do this automatically within NuGet, is there a way to do this with some sort of powershell prebuild script? ie if we know we are building the x86 build is there a way to hook NuGet so that it uses the x86 packaes instead of the x64 packages?
What is the proper way to manage NuGet Packages like this??
In the right pane, look at the System Type entry. For a 32-bit version operating system, it will say X86-based PC. For a 64-bit version, you'll see X64-based PC.
Yes, of course. Most programs are still 32 bit and run fine on 64-bit Windows systems. Those programs are machine language, which has a one-to-one mapping with assembly (and can be easily disassembled into x86 assembly code).
So, target x86 or x64. Since x86 apps run on both x64 and x86 systems, the most compatible choice is to build x86. If you MUST build a 64 bit solution, you'll need to target x64 and use our x64 dlls.
If you use a CPU that supports x64, you should always install a x64 version of windows. A x64 Windows can run both 32 and 64 bit versions of software. But, a x86 can only run 32 bit software. You should download the x86 JDK.
Then you have two approaches,
Create your own ZeroMQ fork and follow System.Data.SQLite.org to implement Native Library Pre-loading. Then you can create a single NuGet package instead of two.
Create two projects for your executable (the same source code, just two project files). One for x86 and the other for x64. Add ZeroMQ's x86 package to your x86 one, while ZeroMQ's x64 to your x64. It is ugly, but IHMO it avoids conditioning in your project file (which can be easily broken by any bad MSBuild parser).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With