dpvreony

Devising a naming convention for .NET projects

Introduction

When structuring repositories it helps to document your naming convention for projects. It helps establish a pattern and practice for the team, ensuring consistency and reducing mental burden on working across codebases. As you add new components you may extend the naming convention or adjust it, but you can add to your CI process checks for projects that don't fit the naming convention.

Be careful about having a naming convention that solely uses a technology and\or brand name. Some toolsets can use internal concepts that misbehave. One such example is Xamarin Forms when using the namespace "Android" as demonstrated by [James Montemagno's December 2020 blog post](https://montemagno.com/dont-put-android-in-your-namespace-in-xamarin-apps/).
This is not meant to be definitive, it's an example pattern. You may be using a tech stack that has different concepts ranging from COM+ libraries, device drivers to plug in's for web browsers or applications.
Project Name Suffix Description
?.ClientStrongly Typed Client Logic. i.e. Http clients
?.DotNetToolDot Net Core Command Line Tool
?.ServerShared Server Logic
?.SharedShared Client \ Server Logic
?.WebSocketAppWeb Socket Application (If using one and splitting from WebApp \ WebApi app)
?.WebAppWeb Application
?.WinformsAppWinforms Application
?.WpfAppWPF Application
?.TestingReusable Testing logic for use in Unit Tests and Integration Tests
?.UnitTestsUnit Tests for the whole solution
?.IntegrationTestsIntegration Tests for the whole solution
?.BenchmarksBenchmarks for the whole solution
?.MsiInstallerWindows MSI installer
?.ForAndroidReusable logic for use in a platform such as Android whilst avoiding toolchain issues.[1]

How do you check the naming convention automatically?

TODO.

References

Montemagno, James (2020) Don't Put Android in Your Namespace in Xamarin Projects https://montemagno.com/dont-put-android-in-your-namespace-in-xamarin-apps/ (Accessed 2020-03-26)
Article Status Draft
Article Version 0.2
First Written Saturday, March 6, 2021
Last Revision Friday, March 26, 2021
Next Review Saturday, June 26, 2021
License MIT