简体   繁体   中英

What's the right way to manage dependencies of dependencies for libraries in .NET Framework?

I have a .NET Framework project with a set of dependent assemblies. One of these assemblies has a dependency on a third assembly.

Project 1 depends on --> Assembly A which depends on --> Assembly B

What I would like to do is ensure that when Assembly A is deployed, Assembly B is included with that deployment. Is there a way to force that dependency check within Assembly A so that if Project 1 is fired up it will fail if Assembly B is not present with Assembly A?

Should I just include Assembly B with Project 1? What I don't like about this is there are no code references within Project 1 for Assembly B. It's misleading when reviewing the project as it's not apparent this dependency is needed because of Assembly A.

  1. Make sure author of NuGet that you've used to add "Assembly A" authored it properly and included references to all related NuGets correctly.

  2. If you don't use NuGet to add "Assembly A" - request NuGet to be create for "Assembly A" and go to 1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM