How to add shared C# NuGet dependencies to a C++/Cli project?

梦想的初衷 提交于 2019-12-01 03:00:25

In your C++/CLI project, just add a reference (Menu->References->Add New Reference->Browse->Browse...) to the nlog.dll that nuget downloads to your [solutionfolder]/packages/nlog... folder. That seems to work for me.

The way I've done it, is to make a "nugetmaster", which references all the nugets the other two projects will use. Build that one first, and reference the nuget assemblies manually within each project. Added bonus is to have more control on versions, only once place to update all other projects. And this scales well.

Another approach is similar to the one above - create a shared C# assembly used by them both, which also implements all the code using the nuget assemblies. And only expose wrappers.

Please refer to NuGet documentation especially the "-IncludeReferencedProjects" parameter.

"From a project" section; http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package

Regards...

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