Is it possible to specify and install dll packages alongside a dotnet cli tool?

22 views Asked by At

I am creating a dotnet cli tool which must support modular architecture and work with plugins. The plugins will be provided as separate nuget packages.

I need to know how can I install such a package, and how to tell my dotnet cli tool where to look for the dll of the modules, so that when I run the tool, the respective modules are also loaded alongside it. It is important that while I want the modules for the cli tool to be provided as nuget packages, it is undesirable to make those nuget packages dependencies to any project that might use the tool.

For example:

  • Let MyTool be the CLI tool I talk about.
  • Let MyTool.CsvReader is a module for the CLI tool that is provided as a dll in a nuget package.
  • Let MyProject is a random C# project, where I need to invoke the tool as part of the build chain.

I have looked at this StackOverflow post which discusses installing a CLI tool in a way that it is manageable by MSBuild, which seems very neat for CI scenarios. I'd be happy to know if I can extend this solution so that I can provide additional nuget packages for my tool and make them "discoverable" by it somehow. However, I would prefer that the tool dependencies are not installed as dependencies into MyProject.

0

There are 0 answers