How should I create or upload a 32-bit and 64-bit NuGet package?

Anthony Mastrean picture Anthony Mastrean · Oct 14, 2011 · Viewed 12.5k times · Source

I have an x86 and x64 version of a binary that I want to upload to NuGet. What's the recommendation or required method for creating/uploading that package? I can't find much to base my decision on. I see two methods...

  1. Upload them both in the same package
    • Which one should I install by default?
    • Is there a way to test the processor architecture of the project to make the decision?
  2. Upload two separate packages

Bonus question: What if I'm using something like Chocolatey, which wraps up NuGet with package manager semantics? I might need/want the x86 and x64 packages installed on my system.

Answer

Anthony Mastrean picture Anthony Mastrean · Nov 22, 2011

We've been discussing a similar issue on the Chocolatey Google Group. There aren't any semantics built into NuGet. The requirement wouldn't be, what processor architecture are you running on. It would have to be what processor architecture is your project targeting. And then that complicates things... you'd have to understand AnyCPU as well.

I think for now, I'm going to upload two packages. I can always published a combined one when I fix up an install.ps1 that can handle querying the project target.

mypackage.x86
mypackage.x64