简体   繁体   English

项目和程序集命名约定

[英]Project and assembly naming conventions

There is Microsoft names of assemblies guideline but personally I don't like lengthy names in solution tree. 汇编指南的Microsoft名称,但我个人不喜欢解决方案树中冗长的名称。 When there are dozen of lengthy names it's hard to pick the project you want. 当有十几个冗长的名字时,很难选择你想要的项目。

Do you keep project name same as assembly name or short it somehow? 您是否将项目名称与程序集名称保持一致或以某种方式缩短它?

For example if there is MyCompany.MyProject.Dal.dll assembly maybe it's more useful to name project simply Dal (but make it compilable into MyCompany.MyProject.Dal.dll) ? 例如,如果有MyCompany.MyProject.Dal.dll程序集可能将项目命名为Dal (但可以将其编译为MyCompany.MyProject.Dal.dll)更有用吗?

Thank you in advance! 先感谢您!

The project name (in common with the solution name) doesn't really matter to the output , as long as the project's "Assembly name:" and "Default namespace:" options are set correctly. 只要项目的“程序集名称:”和“默认命名空间:”选项设置正确,项目名称(与解决方案名称一样)对输出并不重要。 So have fun, but I wouldn't take them too far from the namespace. 因此,有乐趣,但我不会把它们命名空间太远

If your namespace is FooCorp.MegaProject.DAL.dll , then anyone with the project already knows they work for FooCorp , and they probably already have the project named on disk as MegaProject , so it probably isn't going to add much confusion to just have DAL.csproj , especially if this is in the path "...\\FooCorp\\MegaProject\\DAL\\DAL.csproj" or similar. 如果您的命名空间是FooCorp.MegaProject.DAL.dll ,那么任何拥有该项目的人都已经知道它们适用于FooCorp ,并且他们可能已经将该项目命名为磁盘上的 MegaProject ,因此它可能不会增加太多混乱有DAL.csproj ,特别是如果它在路径“... \\ FooCorp \\ MegaProject \\ DAL \\ DAL.csproj”或类似的。 I've certainly done this before (at my last job, where we had hundreds and hundreds of assemblies). 我之前确实做过这件事(在我上一份工作中,我们有成百上千的装配)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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