Skip to content

Conversation

@jasongin
Copy link
Member

@jasongin jasongin commented Jan 15, 2026

When provided duplicate reference assemblies, the type-definitions generator tool crashed with the following stack trace:

Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: <assemblyname>
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Microsoft.JavaScript.NodeApi.Generator.TypeDefinitionsGenerator.GenerateTypeDefinitions(String assemblyPath, IEnumerable`1 referenceAssemblyPaths, IEnumerable`1 systemReferenceAssemblyDirectories, String typeDefinitionsPath, IDictionary`2 modulePaths, String targetFramework, Boolean isSystemAssembly, Boolean suppressWarnings, IEnumerable`1 excludePatterns) at TypeDefinitionsGenerator.cs line 273
   at Microsoft.JavaScript.NodeApi.Generator.Program.Main(String[] args)

De-duplicating the list of provided reference assembly paths fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants