[![Downloads][Downloads-shield]][Downloads-url][![Contributors][contributors-shield]][contributors-url][![Forks][forks-shield]][forks-url][![Stargazers][stars-shield]][stars-url][![Issues][issues-shield]][issues-url][![License][license-shield]][license-url][![LinkedIn][linkedin-shield]][linkedin-url]
Dotnet.DefaultFiles
This repository provides a template for initializing .NET projects with default files and a setup script. It is designed to help developers quickly scaffold a new solution following Clean Architecture principles, including recommended folder structure, configuration, and build scripts.
Table of Contents
- Overview
- Setup & Usage
- Default Files Included
- Workflow
Overview
Dotnet.DefaultFiles serves as a starting point for .NET development. It includes:
- Standard files for solution and project setup
- PowerShell script for creating a new Clean Architecture project
Setup & Usage
Initializing a New Project
- Create a folder with the name of your new solution.
- Download the setupSolutionCleanArchentectureCSharp.ps1 script from this repository and place it in the new folder.
curl -LJO https://raw.githubusercontent.com/TirsvadCLI/Dotnet.DefaultFiles/refs/heads/main/setupSolutionCleanArchentectureCSharp.ps1
- Run the provided PowerShell script to scaffold a new solution:
./setupSolutionCleanArchentectureCSharp.ps1
This will create the recommended folder structure, add default files, and configure the solution for Clean Architecture.
Example with a blazor project:
We will create a new folder named MyBlazorApp, download the setup script, and run it to scaffold a new Blazor project with Clean Architecture principles:
mkdir MyBlazorApp
cd MyBlazorApp
curl -LJO https://raw.githubusercontent.com/TirsvadCLI/Dotnet.DefaultFiles/refs/heads/main/setupSolutionCleanArchentectureCSharp.ps1
./setupSolutionCleanArchentectureCSharp.ps1 blazor
The folder structure will be created as follows:
MyBlazorApp/
├── src/
│ ├── Domain/ # Business logic and entities
│ ├── Application/ # Application services and use cases
│ ├── Infrastructure/ # Data access, external services
│ ├── Web/ # Web UI projects
│ │ ├── TirsvadCLI.TestingScript.Web/ # Blazor project
│ │ └── TirsvadCLI.TestingScript.Web.Client/ # Blazor WebAssembly project
│ └── WebApi # Web API project
├── docs/ # Documentation and design files
├── tests/ # Test projects
└── .github # GitHub configuration files
Customizing
- Edit configuration files as needed (e.g., global.json, Directory.Build.props).
- Add or update environment variables for your setup.
Default Files Included
- global.json: .NET SDK version management
- Directory.Build.props / Directory.Build.targets: Solution-wide build settings
- .gitignore: Standard ignore rules
- nuget.config: Custom NuGet feeds
- Example scripts for setup and build
Best Practices
- Keep source code in src/, tests in tests/.
- Use environment variables for sensitive data.
- Update README.md with any new setup or usage instructions.
For more details, see the Microsoft documentation and Clean Architecture guides.
License
Distributed under the AGPL-3.0 License.
Contact
Jens Tirsvad Nielsen - LinkedIn
Acknowledgements