C# for a TypeScript developerSolutions, projects, and packages
No narration yet
Module 1 · Lesson 411 min

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.

domain/Fusion.Domain.csproj (real)
<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>
Practice

Try it yourself

Do

Walk the project graph

Get oriented in a real multi-project solution before you touch any code.

Tick every step to confirm you did it.

Recall

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?