Skip to content

.NET Solutions

Ben edited this page Jan 13, 2024 · 1 revision

.NET Solution Structure

.NET Solution Structure - Single Project

Note

TODO - Create a template repo for this structure.

{Solution Folder}
├── README.md
├── {Solution File Name}.sln
├── src
│   ├── {Project File Name}.csproj
│   └── version.json
└── tests
    ├── GlobalUsings.cs
    └── {Project File Name}.Tests.csproj
  • {Solution Folder} - The folder for the entire solution. The name of the folder is the same as the {Project File Name}.
    • README.md - The readme for the solution, providing an overview of the solution, project specific developer environment set, project specific how to use the library, project specific DevOps process, etc. Any common practices, standards, etc. (found on the TeqBench - Docs - Wiki) are referenced from the readme as apply to the solution and the projects within.
    • {Solution File Name} - The .NET solution file.
    • src - The folder for the solutions's source code.
      • {Project File Name} - The name of the .NET project file which also corresponds to the RootNamespace and AssemblyName as defined in the project file. In this structure, there is only ONE project in the src folder.
      • version.json - The file containing the version information for the project. Updated as part of GitHub Actions workflow for the associated repo.
    • tests - The folder for the solution's test suite. There is one test project per project found in the src folder.
      • GlobalUsings.cs - usings to be shared across test project's c# files.
      • {Project File Name}.Tests - The name of the .NET test project containing the test suite for the associated {Project File Name} found in the src folder.

Example

teqbench.system.cors
├── README.md
├── TeqBench.System.Cors.sln
├── src
│   ├── Config
│   │   ├── CorsPolicyConfig.cs
│   │   └── ICorsPolicyConfig.cs
│   ├── PolicyManager.cs
│   ├── TeqBench.System.Cors.csproj
│   └── version.json
└── tests
    ├── CorsPolicyConfigTests.cs
    ├── GlobalUsings.cs
    ├── PolicyManagerTests.cs
    └── TeqBench.System.Cors.Tests.csproj