如果我有一个解决方案文件夹,是否可以将项目命名为 ProjectName 而不是 MyCompany.MySolution.ProjectName?
因此目录布局将如下所示:
Visual Studio 2008\
Projects\
MyCompany.MySolution\
Models\
Models.Tests\
Services\
Services.Tests\
UI\
etc..
而不是
Visual Studio 2008\
Projects\
MyCompany.MySolution\
MyCompany.MySolution.Models\
MyCompany.MySolution.Models.Tests\
MyCompany.MySolution.Services\
MyCompany.MySolution.Services.Tests\
MyCompany.MySolution.UI\
etc..
每个项目的命名空间当然是 MyCompany.MySolution.MyProject。
这个问题是由于担心最大字符路径限制 260 而产生的。对我来说,尽我所能自由命名我的项目和解决方案似乎更好; 但是,我不想遇到不可预见的混乱。
So the directory layout would look like:
Visual Studio 2008\
Projects\
MyCompany.MySolution\
Models\
Models.Tests\
Services\
Services.Tests\
UI\
etc..
rather than
Visual Studio 2008\
Projects\
MyCompany.MySolution\
MyCompany.MySolution.Models\
MyCompany.MySolution.Models.Tests\
MyCompany.MySolution.Services\
MyCompany.MySolution.Services.Tests\
MyCompany.MySolution.UI\
etc..
The namespace for each project would of course be MyCompany.MySolution.MyProject.
The question was generated by concern over maximum character path limit of 260. It seems better to me to do whatever I can to be able to freely name my projects and solutions; however, I don't want to run into an unforeseen mess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你达到了角色路径限制,你就必须做点什么,并且必须发挥创造力。 在这种情况下,将文件名更改为不太理想的约定是合理的。 将项目名称从包含完整命名空间降级为仅包含项目名称似乎是合理的。 否则,请尽可能考虑使用缩写词。 这种方法会对很多人有所帮助。
If you run up the character path limit, you have to do something and you have to get creative. In this case, it is reasonable to alter the filename to a less-than ideal convention. Demoting the project names from including the complete namespace to merely the project name seems reasonable. Otherwise, consider using acronyms whenever you can. This approach will help a bunch.