msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Bug]: `ResolveKeySource` is not a dependency of `CoreCompile`

Open jjonescz opened this issue 8 months ago • 4 comments

Issue Description

CoreCompile target calls Csc with KeyFile="$(KeyOriginatorFile)". This KeyOriginatorFile property is set by the ResolveKeySource target. ResolveKeySource target is not a dependency of CoreCompile (although it is a dependency of e.g., Compile and CoreBuild) Most of the time it seems the ResolveKeySource target is actually executed before CoreCompile so everything works fine - but sometimes it doesn't: https://github.com/dotnet/roslyn/issues/74156

Steps to Reproduce

  1. Clone roslyn at 31e6ba81af842e960aa04850b0e63229874d4f02
  2. Run .\Restore.cmd
  3. Open in VS IntPreview Version 17.11.0 Preview 3.0 [35026.344.main]
  4. Run Build > Build Solution - succeeds
  5. Run Build > Build Solution again - fails - see https://github.com/dotnet/roslyn/issues/74156

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

CSC error CS8102: Public signing was specified and requires a public key, but no public key was specified. [D:\roslyn-D\src\VisualStudio\CSharp\Impl\Microsoft.VisualStudio.LanguageServices.CSharp.csproj]

Analysis

No response

Versions & Configurations

No response

jjonescz avatar Jun 28 '24 12:06 jjonescz