.NET › .NET CLI, SDK & Project Structure (csproj)
How do project references (<ProjectReference>) differ from package references, and how do they affect build order?
AdvancedAnswer
A <ProjectReference> points to another project's .csproj file within the same solution/repository, letting MSBuild automatically determine build order (dependencies built first) and always use the latest local source rather than a published NuGet package. This is preferred during active co-development of related projects, while PackageReference is used for external or independently versioned/released dependencies.
<ItemGroup>
<ProjectReference Include="..\MyLib\MyLib.csproj" />
</ItemGroup>
<!-- MSBuild automatically builds MyLib first, then this project -->Real-world example A solution with an API project and a shared Models class library uses a ProjectReference so any change to Models is immediately reflected in the API build without needing to publish and consume an internal NuGet package.