Best practices for referencing 3rd party assemblies

后端 未结 3 1509
青春惊慌失措
青春惊慌失措 2021-02-16 00:26

I have been wondering what are best practices when it comes to referencing 3rd party assemblies. A while ago I asked a question \"Dependencies and references: what exactly shoul

3条回答
  •  有刺的猬
    2021-02-16 00:48

    An alternate I've been using on many (C#) projects is:

    • Make a "Bin" folder in the solution directory (same level as the project directories)
    • Make the output of all projects ../Bin instead of bin/debug or bin/release
    • Put whatever files that are not a result of the build in "Bin", including library dependencies, certain data files or whatever, depending on the project
    • Contents of "Bin" also goes to source control (without the build output, of course)
    • Whatever libraries directly referenced by your projects goes to a "References" or "Libs" folder (sometimes I've also tried putting them in Bin too, but in this case you need to remember to disable copying of references to output dir when adding the reference to your project, which becomes tedious on large projects)

    Not really sure if it's a good solution, but has worked for me till now.

提交回复
热议问题