A .NET solution following modern best practices and coding standards.
Teck.Cloud/
├── .config/
│ └── dotnet-tools.json # Local dotnet tool manifest
├── src/
│ └── Teck.Cloud.Core/ # Core library project
│ ├── Models/ # Domain models and result types
│ └── ValueObjects/ # Value objects (e.g., EntityId)
├── tests/
│ └── Teck.Cloud.Core.Tests/ # Unit tests for Core library
│ ├── Models/ # Tests for models
│ └── ValueObjects/ # Tests for value objects
├── Directory.Build.props # Shared build properties
├── Directory.Packages.props # Centralized package management
├── global.json # SDK version control
├── nuget.config # NuGet package source configuration
└── Teck.Cloud.sln # Solution file
global.json: Locks the .NET SDK version to ensure consistent builds across environmentsDirectory.Build.props: Defines shared metadata, code quality settings, and build properties for all projectsDirectory.Packages.props: Centralizes NuGet package version management across all projectsnuget.config: Configures package sources and package source mapping
.config/dotnet-tools.json: Manages local dotnet tool dependencies for reproducible builds
- ✅ Nullable reference types enabled
- ✅ Warnings treated as errors
- ✅ Deterministic builds
- ✅ Centralized package management
- ✅ xUnit test framework
- ✅ Code coverage with Coverlet
- ✅ Test isolation and proper fixtures
- ✅ 100% code coverage target
- ✅ Records for immutable data types
- ✅ Value objects to avoid primitive obsession
- ✅ Result types for explicit error handling
- ✅ Functional programming patterns where appropriate
- ✅ Sealed classes by default
- .NET SDK 10.0.100 or later
- Visual Studio 2022 or VS Code with C# extension
dotnet restore
dotnet builddotnet testdotnet test --collect:"XPlat Code Coverage"-
Create the project:
dotnet new classlib -n YourProject -o src/YourProject
-
Add to solution:
dotnet sln add src/YourProject/YourProject.csproj
-
Create corresponding test project:
dotnet new xunit -n YourProject.Tests -o tests/YourProject.Tests dotnet sln add tests/YourProject.Tests/YourProject.Tests.csproj dotnet add tests/YourProject.Tests/YourProject.Tests.csproj reference src/YourProject/YourProject.csproj
-
Add package version to
Directory.Packages.props:<PackageVersion Include="PackageName" Version="1.0.0" />
-
Add package reference to your project (without version):
<PackageReference Include="PackageName" />
-
Restore packages:
dotnet restore
See the .cursor/rules/ directory for detailed coding standards and best practices:
- C# Coding Style: Functional patterns, immutable data, value objects
- Testing Guidelines: xUnit patterns, test isolation, TestContainers for integration tests
- Solution Management: SDK versioning, build properties, package management
- Dependency Management: Security scanning, license compliance, version management