Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Feature: Add 1st class support for assembly platform (x86, x64, ARM, Any CPU) [679]

$
0
0
I have a number of 3rd party assemblies that I would like to use nuget with but they have native platform dependencies. Currently the only solution is to create multiple packages specifying the platform in the name, or, not use the lib directory and work some PowerShell magic so the package can contain multiple assemblies with different platform targets. "Multiple packages" is not an actual workaround since I wouldn't be able to take a dependency on a platform-specific package from an "Any CPU" package.

I would like nuget to support multiple assemblies from the lib folder based on the project's current platform target. For example, something like this would work:

lib\{framework name}{version}\{platform}
lib\.NetFramework 2.0\x86\
lib\.NetFramework 2.0\x64\

One approach that may work with nuget is to specify the MSBUILD $(Platform) variable in the project's reference hint path. For example:

<Reference Include="sbclient, Version=6.6.0.0, Culture=neutral, PublicKeyToken=371d4a7d6f5d7853">
<HintPath>..\lib\.NetFramework 2.0\sbclient\$(Platform)\sbclient.dll</HintPath>
</Reference>
Comments: Hopefully It shouldn't only be for processor but for some other platform characteristics (i.e. for our project we ship one version of the core assembly for D3D, another one for OpenGL -- that's something we rather do at compile-time instead of runtime interface for performance reasons). Then any sample project should be able to reference the main package that contains both version of the assembly.

Viewing all articles
Browse latest Browse all 7612