The new configuration system hooks into DispatchToInnerBuilds which doesn't run always, ie when a Target is directly invoked which doesn't go through the dispatching from outer to inner build procedure.
An example is GenerateReferenceSource target which uses the IntermediateAssembly item which is undefined because the IntermediateOutputPath isn't set correctly: https://github.com/dotnet/runtime/blob/1a1a541954db674980b09efe426d3b6dfd6ae3c9/src/libraries/Directory.Build.targets#L134.

cc @Anipik @ericstj
Does this mean the GenerateReferenceSource task is currently not working? I'm receiving "The assembly field is required."
I see it working in 6766eb748a7 but broke sometime later.
/cc @khellang
Right, targets like GenerateReferenceSource are currently broken.
@Anipik can we hook GenerateReferenceSource into outer/inner dispatch?
Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.
EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0
@ericstj I will start working on fixing it.
Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.
EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0
For libraries that have OS specific builds the property must contain the OS as well, e.g.: /p:TargetFramework=netcoreapp5.0-Windows_NT.
It depends on the obj directory name of the built lib (e.g.: artifacts\obj\System.Net.Http\netcoreapp5.0-Windows_NT-Debug.)
Most helpful comment
@Anipik can we hook GenerateReferenceSource into outer/inner dispatch?
Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.
EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0