Creating package with x86 and x64 managed and native libraries into single package #9272
Labels
Functionality:Pack
Partner:MSBuild
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
Type:DCR
Design Change Request
Type:Docs
Details about Problem
Here is my current setup. I am creating a game engine in C# that uses SDL. There is a popular C# wrapper library that P/Invokes into
the native SDL2 libraries for the purpose of creating games. These native libraries have x86 and x64 architecture versions of them and
I need to to take advantage of both which means my game engine has only x86 and x64 architectures.
What I am trying to do is create a nuget package that contains multiple architectures of not only the native libraries but of my C# game
engine library as well. I have already learned that I can get the native libraries properly put into the package using the csproj file
XML content that is similar to the what you see below.
This will of course put both the x86 and x64 version of the SDL libraries into the package.
The issue I am having is how do I get both architecture versions of my library into the package as well? My thinking is that the consumer of the package
could use my package and either choose x86 or x64 and Visual Studio would just use the proper architecture for the libraries based on the architecture of their project. Is this even feasible?
I thought that maybe I could do 2 separate packages. One for x86 and one for x64, but that does not seem like the right way to do it and I know there are packages out there that have it all in one. One good example is the System.Data.SQLite.Core nuget package which supports many different platforms and architectures.
I dug into the package and seen that they make use of a build directory which I know are additional instructions for MSBuild to use during the build process. I tried finding documentation on this but I cannot find barely any information on the microsoft docs site or anywhere else on the format and use of the .targets files.
I also do not want to take a path that will eventually be getting deprecated or that is not the recommended way of doing it. An example of this is using .nuspec files. I read that using them is not the preferred way of doing this anymore and that it is only used inside of the package, not part of your project.
Again my end goal is to just simply release multiple architectures of my native AND managed libraries in one package and anybody could just consume it, point to the right architecture and then it works.
I have been struggling with this issue for about 2 weeks and even though I have learned a lot, I am coming up to a dead end. Any help is greatly appreciated.
NuGet Product Used: VS UI
VS Version: 16.4.5
OS Version: win10 - v1709.16299.1625
The text was updated successfully, but these errors were encountered: