我正在尝试在Visual Studio 2019中生成OpenAPI服务参考。.NET 5.0。
Right clicking project >Add>Connected Services>+ Service References
I am using NetDocs api "https://api.vault.netvoyage.com/v2/swagger/docs/v2".
结果:我获得了生成的C#客户端代码,但它正在复制以下错误的类型。
Severity Code Description Project File Line Suppression State
Error CS0102 The type 'v2Client' already contains a definition for '_settings' OpenAPITest C:\Users\dryfus\source\repos\OpenAPITest\obj\v2Client.cs 4941 Active
Error CS0579 Duplicate 'System.CodeDom.Compiler.GeneratedCode' attribute OpenAPITest C:\Users\dryfus\source\repos\OpenAPITest\obj\v2Client.cs 4936 Active
Error CS0102 The type 'v2Client' already contains a definition for '_baseUrl' OpenAPITest C:\Users\dryfus\source\repos\OpenAPITest\obj\v2Client.cs 4939 Active
Error CS0102 The type 'v2Client' already contains a definition for '_httpClient' OpenAPITest C:\Users\dryfus\source\repos\OpenAPITest\obj\v2Client.cs 4940 Active
有什么办法可以使它使用连接器方式使用,而无需重复使用?甚至CLI?关于为什么会创建重复项的任何建议?