CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

IIDOptimizer flakiness

Open dfields-msft opened this issue 1 year ago • 0 comments

Describe the bug Our project has encountered several flaky behaviors with IIDOptimizer.exe:

  1. If .NET 5 is not installed, the exe fails to run, but the build succeeds anyway.
  2. In some cases, the exe runs, and fails with "Failed to resolve WinRT.Runtime.dll"; the build succeeds anyway.
  3. When the exe runs successfully, the build tries to copy a pdb file which (at least sometimes) doesn't exist, and the build does fail... a. But! The next build will succeed because optimization has already run, so the exe exits with code -2 and the pdb copy is skipped.

To Reproduce Unfortunately, I don't have a concise min-repro at this point. (1) can be reproduced easily by running on a system without .NET 5 installed. (2) seems to depend on the project and its dependencies; I have two projects using CsWinRT, and one hits this and the other doesn't. (3) seems to be a simple logic error in the .targets file, though I'm not certain why the pdb is missing and whether that's expected/ok.

Expected behavior I would have expected (1) and (2) to produce build failures, but they just spew to the log and succeed instead. (3) should succeed even in the absence of the pdb (or else the pdb should be reliably populated to the IIDOptimizer directory along with the dll).

Version Info CsWinRT version 1.6.3 .NET SDK 7 Windows SDK 10.0.19041.0

dfields-msft avatar Nov 17 '22 23:11 dfields-msft