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

后端 未结 3 1640
失恋的感觉
失恋的感觉 2021-01-03 20:50

Context: A Visual Studio solution with 2 assemblies, Cs and Cpp.

  • Cs is a C# / .net45 dll
  • Cpp is a C++/Cli dll, a C++ dll compiled with /clr.
3条回答
  •  无人及你
    2021-01-03 21:14

    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.

提交回复
热议问题