Using NuGet Packages
September 21, 2019 ยท View on GitHub
There are three options for using NuGet packages:
- Use
nuget_packagedownload a package from the internet. - Use
import_nuget_packageto point at a directory containing the contents of a package. - Use
import_nuget_packageto point at a.nupkgfile.
(TODO: link to the API reference docs when we have them)
When you use any of these options and don't provide either build_file or
build_file_content, a default BUILD file will be used that calls the
setup_basic_nuget_package macro.
This macro uses import_library to import every DLL and
import_multiframework_library to stitch them together into one target (see
docs/MultiTargetingDesign.md for more info).
The downside to this is that it always leaves deps empty for these targets,
because of limitations with how Bazel works. Your options are:
- Create a better
BUILDfile from scratch (we should provide a tool to do this) and usebuild_file/build_file_content. - Always add the transitive references of your packages to your
depswhen you reference the package.