简体   繁体   中英

How to share many binary files between source projects in one solution?

I have a smallish solution, with about under twenty projects. The solution used to also contain about six source projects written by a third party service provider, ACME. Now, finally, this other party is supplying us only with a handful of DLLs. I used to just included their source, one project per DLL, in the solution, and so I am looking for a neat way to include all these assemblies in the solution, so they can be referenced from the many projects that need them.

My immediately apparent options are:

  1. Create an AcmeAssembly project, add all DLLs as project items set to copy to output.
  2. Create an AcmeAssembly solution folder. Quicker and simpler than a 'binary-only' source project, but solution folders have the very, very large drawback of having no means of grouping the files without a solution file, ie outside of VS.
  3. Create a NuGet package that includes all the required binaries. Then at least we also have a partly 'phycical' grouping in the packages folders. My problem here is I have never written a NuGet package, but I am not asking how to here. I am asking about three candidate solutions, and more will be welcome, and if NuGet wins, I get to learn to write a package.

I can't simply use the project's output bin\\debug and bin\\release folders. To me, these are strictly output folders, and nothing but other dependency assemblies should also be output there. Deleting the bin folder should have absolutely zero effect on a build, so that is certainly no place to store binaries.

Create your Acme library folder (something like: C:\\Source\\Library\\AcmeLibrary). Put all of your Acme dll's in that folder. Then create the Solution Folder in VS and add the existing items to it (don't add the folder, but the items in the C:\\Source\\Library\\AcmeLibrary folder to the solution folder using "Add Existing Item..." menu selection).

The advantages of nuget over the other solutions are:

  1. Support for versioning
  2. Support is built in into Visual Studio and MSBuild
  3. No 'magic folders' that all developers need to have on their machines

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