I have a setup where a library project A is using Extras and is set up to do per-RID builds (for a single net5.0 TFM). This works fine on its own when I type dotnet build in that project. However, when I run dotnet build from inside another library project B, which is just using the regular .NET SDK and which has a ProjectReference to A (with ReferenceOutputAssembly=false), A is only built once (RID-less).
This is problematic for 2 reasons:
Project A is not actually expecting to be built RID-less. This can result in nonsensical combinations of #if paths being taken, possibly leading to compilation errors.
I need to embed the compiled (RID-specific) assemblies from project B as resources in project A, but only the RID-less assembly is available.
(I don't actually know if this behavior is expected/intended and whether it's fixable.)
OK, ignore this. Turns out all I had to do was set SkipGetTargetFrameworkProperties=true on the ProjectReference in addition to ReferenceOutputAssembly=false. Now it builds all RIDs as expected.
I have a setup where a library project A is using Extras and is set up to do per-RID builds (for a single
net5.0
TFM). This works fine on its own when I typedotnet build
in that project. However, when I rundotnet build
from inside another library project B, which is just using the regular .NET SDK and which has aProjectReference
to A (withReferenceOutputAssembly=false
), A is only built once (RID-less).This is problematic for 2 reasons:
#if
paths being taken, possibly leading to compilation errors.(I don't actually know if this behavior is expected/intended and whether it's fixable.)