Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentException: An item with the same key has already been added when generating XML docs #5211

Open
aelij opened this issue Jan 5, 2025 · 0 comments
Labels
v3 Version 3 of AutoRest C# generator.

Comments

@aelij
Copy link
Member

aelij commented Jan 5, 2025

Describe the issue or request
We encountered the following exception. Setting disable-xml-docs: true bypasses the problem. Note that the exception shows a test method name as the duplicate key, although we also set generate-test-project: false.

I can share the project internally.

System.ArgumentException: An item with the same key has already been added. Key: <test method name>
     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 AutoRest.CSharp.AutoRest.Plugins.XmlFormatter.GetMethodsAsync(SyntaxTree syntaxTree) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\AutoRest\Plugins 
  \XmlFormatter.cs:line 156
     at AutoRest.CSharp.AutoRest.Plugins.XmlFormatter.FormatAsync(XmlDocWriter writer, SyntaxTree syntaxTree) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common 
  \AutoRest\Plugins\XmlFormatter.cs:line 23
     at AutoRest.CSharp.AutoRest.Plugins.GeneratedCodeWorkspace.GetGeneratedFilesAsync()+MoveNext() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\AutoRest\ 
  Plugins\GeneratedCodeWorkspace.cs:line 146
     at AutoRest.CSharp.AutoRest.Plugins.GeneratedCodeWorkspace.GetGeneratedFilesAsync()+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()       
     at AutoRest.CSharp.AutoRest.Communication.StandaloneGeneratorRunner.RunAsync(CommandLineOptions options) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common 
  \AutoRest\Communication\StandaloneGeneratorRunner.cs:line 93
     at AutoRest.CSharp.AutoRest.Communication.StandaloneGeneratorRunner.RunAsync(CommandLineOptions options) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common 
  \AutoRest\Communication\StandaloneGeneratorRunner.cs:line 93
     at AutoRest.CSharp.Program.Run(CommandLineOptions options) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 47
     at AutoRest.CSharp.Program.<>c.<<Main>b__2_0>d.MoveNext() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 29
  --- End of stack trace from previous location ---
     at AutoRest.CSharp.Program.Main(String[] args) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 26
     at AutoRest.CSharp.Program.<Main>(String[] args)
@aelij aelij added the v3 Version 3 of AutoRest C# generator. label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Version 3 of AutoRest C# generator.
Projects
None yet
Development

No branches or pull requests

1 participant