How to use nuget runtimes to target different CPU architectures in the same package?

▼魔方 西西 提交于 2019-12-24 02:18:35

问题


I'm trying to create a nuget package for UWP targeting separate CPU architecture builds (arm, x64, x86). I'm using nuget 3.3.0. Reading latest nuget documentation, I understood that this can be achieved using "runtimes" folders.

This is package structure:

Installing the package to a UWP project adds the dependencies but it doesn't add references for assemblies from lib folders as a result I can't use the content. There are no errors packing or installing the package.

Searching on internet I found other ways to pack CPU architecture specific builds (most relevant ones: 1, 2). All of them seems to target old nuget versions (<3.0.0).

Are "runtimes" the right way to solve this problem with latest nuget version? If yes what am I doing wrong?


回答1:


See https://github.com/NuGet/Home/issues/1221.

In summary, you'll have to place your architecture specific binaries in the runtimes folder. In addition you need a surface area implementation to be placed in the ref folder. The trick is to use the corflags command to generate the library for your ref folder.



来源:https://stackoverflow.com/questions/35491904/how-to-use-nuget-runtimes-to-target-different-cpu-architectures-in-the-same-pack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!