<Reference> resolutionMost project files in this repo should use <Reference> instead of <ProjectReference> or <PackageReference>.
This was done to enable ASP.NET Core's unique requirements without requiring most ASP.NET Core contributors
to understand the complex rules for how versions and references should work. The build system will resolve
Reference items to the correct type and version of references based on our servicing and update rules.
See ResolveReferences.targets for the exact implementation of custom
<Reference> resolutions.
The requirements that led to this system are:
<Reference>.<PackageReference>.eng/Dependencies.props and eng/Versions.props.eng/Version.Details.xml.<ProjectReference> in test projects.eng/scripts/GenerateProjectList.ps1 (or build.cmd /t:GenerateProjectList) when adding new projects<SuppressBaselineReference>.Steps for adding a new project to this repo.
eng/scripts/GenerateProjectList.ps1Steps for adding a new package dependency to an existing project. Let's say I'm adding a dependency on System.Banana.
<Reference Include="System.Banana" /><LatestPackageReference Include="System.Banana" Version="0.0.1-beta-1" />If this package comes from another dotnet team and should be updated automatically by our bot...
Version="$(SystemBananaPackageVersion)".<SystemBananaPackageVersion>0.0.1-beta-1</SystemBananaPackageVersion>.Add an entry to eng/Version.Details.xml like this:
<ProductDependencies>
<!-- ... -->
<Dependency Name="System.Banana" Version="0.0.1-beta-1">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>000000</Sha>
</Dependency>
<!-- ... -->
</ProductDependencies>
If you don't know the commit hash of the source code used to produce "0.0.1-beta-1", you can use 000000 as a placeholder for Sha
as its value is unimportant and will be updated the next time the bot runs.
If the new dependency comes from dotnet/CoreFx, dotnet/code-setup or dotnet/extensions, add a
`CoherentParentDependency` attribute to the `<Dependency>` element as shown below. This example indicates the
dotnet/CoreFx dependency version should be determined based on the build that produced the chosen
Microsoft.NETCore.App. That is, the dotnet/CoreFx dependency and Microsoft.NETCore.App should be
coherent.
```xml
<Dependency Name="System.Banana" Version="0.0.1-beta-1" CoherentParentDependency="Microsoft.NETCore.App">
<!-- ... -->
</Dependency>
```
The attribute value should be `"Microsoft.Extensions.Logging"` for dotnet/core-setup dependencies and
`"Microsoft.CodeAnalysis.Razor"` for dotnet/extensions dependencies.
If Microsoft.AspNetCore.Banana in 2.1 had a reference to Microsoft.AspNetCore.Orange, but in 3.0 this reference is changing to Microsoft.AspNetCore.BetterThanOrange, you would need to make these changes to the .csproj file
<!-- in Microsoft.AspNetCore.Banana.csproj -->
<ItemGroup>
- <Reference Include="Microsoft.AspNetCore.Orange" /> <!-- the old dependency -->
+ <Reference Include="Microsoft.AspNetCore.BetterThanOrange" /> <!-- the new dependency -->
+ <SuppressBaselineReference Include="Microsoft.AspNetCore.Orange" /> <!-- suppress as a known breaking change -->
</ItemGroup>
If the dotnet-maestro bot has not correctly updated the dependencies, it may be worthwhile running darc manually:
darc as described in https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#setting-up-your-darc-clientdarc update-dependencies --channel '.NET Core 3 Dev'
'.NET Core 3 Release' in a release/3.0-* branchgit diff to confirm the tool's changes