ComWrappers source generator fails to run: CSC : warning CS8785: Generator 'ComInterfaceGenerator' failed to generate source #111573
Labels
area-System.Runtime.InteropServices
source-generator
Indicates an issue with a source generator feature
untriaged
New issue has not been triaged by the area owner
Description
I'm compiling a class library project with Visual Studio 2022 .NET 9 and when I compile, it raises a CSC 8785 warning and the description of exception: Exception was of type 'ArgumentException' with message 'An item with the same key has already been added.'.
Reproduction Steps
Unfortunately, I can't provide a reproducing project this is a private project that defines around 500 COM interfaces like this:
And the csproj is defined like this:
I've tried to reproduce on a small project but it never fail, it works and I have similar projects that compile fine. It seems the ComInterfaceGenerator doesn't like something specific, but I can't find what it is
Expected behavior
I believe the 'ComInterfaceGenerator' should not fail with unexpected/internal errors like ArgumentException only with a predefined set of diagnostics
Actual behavior
This is Visual Studio CSC outputs:
Regression?
I don't know, I've not tested .NET 8
Known Workarounds
I don't have any
Configuration
Visual Studio 2022 17.12.4
.NET 9.0.1
Windows 11 24H2 x64 26100.2894
Other information
Is there a way to enable some logs or diagnostics so I could at least see where/how it's failing?
The text was updated successfully, but these errors were encountered: