Home > Net >  [for] Swagger error problem
[for] Swagger error problem

Time:09-15

Error below
500: {" Message ":" there is an error, ", "ExceptionMessage" : "has been added with the same key item,", "ExceptionType" : "System. ArgumentException", "StackTrace" : "in the System. ThrowHelper. ThrowArgumentException (ExceptionResource resource) \ r \ n in the System. The Collections. The Generic. The Dictionary ` 2. Insert (TKey key, TValue value, Boolean add) \ r \ n in the System. Web. Http. Description. ApiExplorer. TryExpandUriParameters (IHttpRoute route, HttpParsedRoute parsedRoute, ICollection ` 1 parameterDescriptions, String& expandedRouteTemplate)\r\n 在 System.Web.Http.Description.ApiExplorer.PopulateActionDescriptions(HttpActionDescriptor actionDescriptor, IHttpRoute route, String localPath, Collection`1 apiDescriptions)\r\n 在 System.Web.Http.Description.ApiExplorer.PopulateActionDescriptions(IEnumerable`1 actionDescriptors, String actionVariableValue, IHttpRoute route, String localPath, Collection`1 apiDescriptions, HttpControllerDescriptor controllerDescriptor)\r\n 在 System.Web.Http.Description.ApiExplorer.ExploreRouteActions(IHttpRoute route, String localPath, HttpControllerDescriptor controllerDescriptor, Collection`1 apiDescriptions)\r\n 在 System.Web.Http.Description.ApiExplorer.ExploreRouteControllers(IDictionary`2 controllerMappings, IHttpRoute route)\r\n 在 System.Web.Http.Description.ApiExplorer.InitializeApiDescriptions()\r\n 在 System.Lazy`1.CreateValue()\r\n 在 System.Lazy`1.LazyInitValue()\r\n 在 Swashbuckle.Swagger.SwaggerGenerator.GetSwagger(String rootUrl, String apiVersion)\r\n 在 Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n 在 System.Web.Http.HttpServer. D__0. MoveNext ()}
"

What is the link where to add duplicates, seeks the solution or the solution

CodePudding user response:

This is not a swagger error, check you use the Dictionary Add place, whether to insert the same key value,

CodePudding user response:

The primary key repeat?
SQL, set up a primary key on the no

CodePudding user response:

Repeat the routing?

CodePudding user response:

Someone come across this kind of problem
  • Related