Solutions, projects, and packages
Start with the shapes. A solution (.sln) is a collection of projects. A project (.csproj) is one compiled unit: it produces a DLL and declares its own dependencies and settings. In Node terms, a project is roughly a package, and the solution is the workspace that ties them together.
The Fusion backend is one solution with several projects that stack into layers: domain, application, persistence, presentation/api, and tests. Each is a .csproj. A project references another project explicitly, and the compiler enforces the direction: domain depends on nothing, application depends on domain, and so on. That reference graph is the architecture, made physical.
The .csproj is where package.json and tsconfig.json merge into one file. It sets the target framework, language options, and every NuGet package (the npm of .NET). Here’s the real Fusion domain project.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ardalis.SmartEnum" Version="8.2.0" />
</ItemGroup>
</Project>Try it yourself
Walk the project graph
Get oriented in a real multi-project solution before you touch any code.
- In
~/focused/launchpad/apps/fusion-backend, runlsand note the layer folders:domain,application,persistence,presentation,tests - Open
domain/Fusion.Domain.csprojandapplication/Fusion.Application.csprojand compare theirPackageReferenceandProjectReferencelines - Confirm
applicationreferencesdomainbutdomainreferences no other project
What the .csproj is
Anchor the mapping.
A TS colleague asks what a .csproj file is in terms they'd know. What do you say?
Reveal answer
It's package.json and tsconfig.json combined for one project: it sets the target framework and language options (like tsconfig) and lists the NuGet dependencies (like package.json dependencies). The .sln above it is the workspace.