Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Solutions and project references

โญ beginnerโณ 12 min read๐Ÿ“ Lesson 72 of 85

A solution binds many projects; ProjectReference wires dependencies between them.

The solution file

dotnet new sln -n Shop
dotnet new console -o Shop.App
dotnet new classlib -o Shop.Core
dotnet sln add Shop.App Shop.Core

.sln is a manifest listing projects โ€” open it in an IDE and every project loads together. The layering is a dependency direction: Shop.App uses Shop.Core's code, not the reverse.

ProjectReference

<!-- Shop.App/Shop.App.csproj -->
<ItemGroup>
  <ProjectReference Include="..\Shop.Core\Shop.Core.csproj" />
</ItemGroup>

With that line, Shop.App can using Shop.Core; and the build system compiles Core first, then App. The difference between ProjectReference and PackageReference matters: a project reference is your source, rebuilt with the solution; a package reference is someone else's published binary from NuGet, versioned and immutable.

โšก Now practice

Ready to Code
Project workshopcsproj parsing, dependency graphs, CLI verb effects, and release-vs-debug reasoning โ€” project knowledge as code.
4 challenges ยท ยท ~40 min