NetEvolve.Defaults is a comprehensive enterprise-grade build automation and configuration platform that establishes consistent development standards across all NetEvolve projects. It provides unified build properties, standardized configuration files, integrated code analysis, and development guidelines that enforce quality, consistency, and best practices throughout your entire project ecosystem.
This repository contains a complete infrastructure for maintaining code quality and consistency across distributed teams and projects. It encompasses:
- NetEvolve.Defaults: The foundational build configuration package providing MSBuild properties, targets, and shared settings
- NetEvolve.Defaults.Analyzer: A comprehensive Roslyn-based diagnostic analyzer enforcing NuGet package quality standards
- Build & Configuration Files: Centralized editor configuration, version management, and continuous integration settings
- Centralized Build Configuration: Unified project settings and compilation options for single and multi-targeted projects
- Code Analysis & Quality Enforcement: Automated static analysis with Roslyn analyzers and code style enforcement via
.editorconfig - Modern Language Features: C# 13 language features with nullable reference types, implicit usings, and file-scoped namespaces
- Continuous Integration Support: Automatic detection and optimization for CI/CD environments with GitVersion integration
- NuGet Security Auditing: Integrated vulnerability scanning for package dependencies via NuGet Audit
- Semantic Versioning: Automated semantic versioning powered by GitVersion for consistent version management
- Package Quality Standards: Enforced NuGet metadata validation ensuring professional package documentation and discoverability
- Multi-Framework Support: Seamless configuration for projects targeting multiple .NET frameworks
Install the core package in your project:
dotnet add package NetEvolve.DefaultsFor enhanced package quality validation, also add the analyzer:
dotnet add package NetEvolve.Defaults.AnalyzerAdd to your project file (.csproj, .fsproj, or .vbproj):
<ItemGroup>
<PackageReference Include="NetEvolve.Defaults" Version="x.x.x" PrivateAssets="all" />
<PackageReference Include="NetEvolve.Defaults.Analyzer" Version="x.x.x" PrivateAssets="all" />
</ItemGroup>The PrivateAssets="all" attribute ensures that these build utilities are only applied to your project and not propagated to consumers of your packages.
defaults/
├── src/
│ ├── NetEvolve.Defaults/ # Core build configuration package
│ └── NetEvolve.Defaults.Analyzer/ # NuGet package quality analyzer
├── tests/
│ └── NetEvolve.Defaults.Tests.Integration/ # Integration tests
├── docs/
│ └── usage/ # Diagnostic rule documentation
├── decisions/ # Architectural decision records
├── .github/ # GitHub workflows and instructions
├── Directory.Packages.props # Centralized NuGet version management
├── Directory.Build.props # Global MSBuild properties
├── Directory.Build.targets # Global MSBuild targets
└── GitVersion.yml # Semantic versioning configuration
The foundational package providing standardized build settings:
- MSBuild Properties & Targets: Consistent compilation configuration across all projects
- Editor Configuration: Standardized code style rules via
.editorconfig - Analyzer Settings: Pre-configured Roslyn analyzer rules matching enterprise standards
- NuGet Audit Integration: Automated security vulnerability scanning
- Language Configuration: Modern C# language features with sensible defaults
Learn more about NetEvolve.Defaults →
Comprehensive diagnostic analyzer for NuGet package quality:
- Package Metadata Validation: Ensures complete and professional package information
- Repository Configuration: Validates repository URLs, issue trackers, and licensing
- Build Standards Enforcement: Verifies compliance with modern build patterns
- Real-Time Diagnostics: Immediate feedback during development with actionable fixes
- 9+ Diagnostic Rules: Covering critical package configuration aspects
Learn more about NetEvolve.Defaults.Analyzer →
The analyzer package enforces standardized quality checks via diagnostic rules. For detailed documentation on all rules and remediation steps:
All settings can be customized through:
- Project File Properties: Override specific settings in individual
.csprojfiles - Directory.Build.props: Apply settings across all projects in a solution
- .editorconfig: Customize code style and formatting rules
- .github/instructions: Apply project-specific guidelines and conventions
Enable Preview Language Features:
<PropertyGroup>
<LangVersion>preview</LangVersion>
</PropertyGroup>Disable Nullable Reference Types (Not Recommended):
<PropertyGroup>
<Nullable>disable</Nullable>
</PropertyGroup>Customize Target Frameworks:
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>- Use PrivateAssets="all": Ensures build tools don't leak into package consumers
- Enable Nullable Reference Types: Improves type safety and reduces null reference exceptions
- Use Implicit Usings: Reduces boilerplate and improves code readability
- Configure Complete Metadata: Ensure all NuGet package properties are set for discoverability
- Run Analyzers Regularly: Address diagnostics during development, not at release time
- Test Multi-Framework Projects: Verify code works across all target frameworks
This project follows architectural principles documented in the decisions/ folder. Key decision areas include:
- Folder Structure & Naming Conventions: Consistent project organization
- Centralized Package Management: Single source of truth for NuGet versions
- English as Project Language: All code, documentation, and comments in English
- .NET 10 & C# 13 Adoption: Modern language features and runtime support
- Conventional Commits: Structured commit messages for automated versioning
- GitVersion Integration: Automated semantic versioning from git history
For more details, see Architectural Decisions.
Contributions are welcome! When contributing to this project:
- Follow the existing code style and conventions
- Ensure all diagnostic analyzers pass without warnings
- Update relevant documentation
- Follow Conventional Commits format for commit messages
- Add tests for new functionality
For issues, feature requests, or questions:
- NetEvolve.Defaults Documentation
- NetEvolve.Defaults.Analyzer Documentation
- Diagnostic Rules Reference
- Architectural Decisions
This project is licensed under the MIT License.