Adding a dll file to a C# project

2019-02-17 16:25发布

It's a beginners question, but...

Image of dll reference and dll included in project file http://a3.vox.com/6a00c2251e5b66549d00e398ca81eb0003-pi

If you look at the image above, there is the "Bass.Net" dll added as reference and also directly as file in the project.

Can someone tell me what's the point of doing that?

7条回答
Bombasti
2楼-- · 2019-02-17 17:08

This actually might be a good idea in a lot of circumstances. In my opinion their are 3 types of dependencies

  1. Assemblies from the .Net standard library. Never include those locally.
  2. Assemblies that you expect other developers to install as part of an MSI or exe setup package. This usually means their strongly signed and have a copy in the GAC.
  3. Assemblies that you don't expect other developers to install via an MSI or exe installer. Maybe because you have a third party or in house library not in the GAC.

In the third case, the simplest thing to do is store a copy of the DLL in the source repo.

查看更多
登录 后发表回答