Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

assembly naming conventions

Assuming you have a namespace that is useful to more than one project in your company, in the format of "MyCompany.Core", would you have an assembly named exactly the same way or just "Core". Why or why not?

like image 483
Berryl Avatar asked Feb 02 '10 23:02

Berryl


2 Answers

Use the standard .NET naming conventions, assembly names are covered here. I'll save you the (short) read:

Do choose names for your assembly DLLs that suggest large chunks of functionality such as System.Data. Assembly and DLL names do not have to correspond to namespace names but it is reasonable to follow the namespace name when naming assemblies.

Consider naming DLLs according to the following pattern:
<Company>.<Component>.dll
Where <Component> contains one or more dot-separated clauses.

For example, Contoso.WebControls.dll.

like image 175
Hans Passant Avatar answered Sep 18 '22 20:09

Hans Passant


I believe it's best (opinion here!) to name the assembly after the root namespace it contains, in your case MyCompany.Core.dll. You never know if that file will make its way outside the company, and keeping track of it is just easier in general.

Imagine if Microsoft named System.Core just Core.dll (System.Core), then you had Core.dll (MyCompany.Core)....you imagine how that gets hairy fast.

like image 37
Nick Craver Avatar answered Sep 17 '22 20:09

Nick Craver