Open jjonescz opened 3 days ago
In that binlog:
CoreCompile
is running because of <Target Name="_SetGeneratedOutputItems" DependsOnTargets="CoreCompile">
from microsoft.visualstudio.extensibility.jsongenerators.sdk\17.10.2079\build\Microsoft.VisualStudio.Extensibility.JsonGenerators.Sdk.props
ExtensionJsonOutputGroup
I think two things should be done:
Compile
instead of CoreCompile
, which would trigger all of $(CompileDependsOn)
in order and work.CoreCompile
for VB and C# should consider adding an explicit dependency on ResolveKeySource
.The reason I'm saying "consider" for 2 is that right now CoreCompile
doesn't really have any explicit dependencies and depends on the implicit $(BuildDependsOn)
/$(CompileDependsOn)
ordering. That can produce other problems like this (I'm a bit surprised for example that NuGet references made it into this compilation)--but adding a constraints to target order has been a surprisingly breaking operation in the past due to how people have hooked the fragile existing system.
Issue Description
CoreCompile
target callsCsc
withKeyFile="$(KeyOriginatorFile)"
. ThisKeyOriginatorFile
property is set by theResolveKeySource
target.ResolveKeySource
target is not a dependency ofCoreCompile
(although it is a dependency of e.g.,Compile
andCoreBuild
) Most of the time it seems theResolveKeySource
target is actually executed beforeCoreCompile
so everything works fine - but sometimes it doesn't: https://github.com/dotnet/roslyn/issues/74156Steps to Reproduce
.\Restore.cmd
Creating a minimal repro would be complicated, I don't know the exact conditions needed to get the buggy ordering of targets.
Here's the binlog (from a VS build) where I saw the issue: vs.binlog.zip
Expected Behavior
Build succeeds the second time.
Actual Behavior
Analysis
No response
Versions & Configurations
No response