Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single NuGet Package Containing x86 ARM x64 binaries

Is there any way of making a single NuGet package that contains binaries targeting x86 ARM x64 etc. so that VisStudio/MSBuild will pick up the correct binaries for each given build configuration?

I can only see support for os target - i.e. Windows, Windows8, win, win8, wp, wp7, WindowsPhone, WindowsPhone7, silverilght4-wp71, wp71, WindowsPhone71 etc.

And you end up with a folder structure like this:

\content
    \net11
    \MyContent.txt
    \net20
        \MyContent20.txt
    \net40
    \sl40
        \MySilverlightContent.html

\tools
    init.ps1
    \net40
        install.ps1
        uninstall.ps1
    \sl40
        install.ps1
        uninstall.ps1

Do I really have to do some powershell-script or pre-build step to accomplish this? It seems like this should be supported by NuGet out-of-the-box?

If I do have to use a script - does anyone have good example code? A ps1 script or some sort of build hook?

I also found this work item on the subject: http://nuget.codeplex.com/workitem/679. But its been around since June 2011, last commented in July.

Any ideas?

Many thanks, Jon

Sources:

  • http://docs.nuget.org/docs/release-notes/nuget-2.1
  • http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Framework_Names
like image 443
Jon Rea Avatar asked Oct 25 '12 09:10

Jon Rea


People also ask

What does a NuGet package contain?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.

What is a NuGet package and what is it used for?

NuGet is a package manager that delivers compiled source code (DLLs) and other files (scripts and images) related to code. A NuGet package takes the form of a zip file with the extension . nupkg. This makes adding, updating, and removing libraries easy in Visual Studio applications.

How do I download NuGet packages locally?

Open your file, and inside packageSources add a new local key following this structure <add key="local" value="path" /> . This path can be a relative or absolute from NuGet. config folder. Now you can install a package locally with dotnet add package and source option to local.


1 Answers

As far as I know, this is still unsupported.

This SO question has two answers that should work for you, one for addressing this with a single package, the other a simple multipackage solution:

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

like image 194
kiprainey Avatar answered Nov 18 '22 14:11

kiprainey