Swagger See config settings - "CustomSchemaIds" for a workaroundapi
1 System.InvalidOperationException: Conflicting schemaIds: Identical schemaIds detected for types BDtos.ImportExcelSaveDataDto and ADtos.ImportExcelSaveDataDto. See config settings - "CustomSchemaIds" for a workaround 2 at Swashbuckle.AspNetCore.SwaggerGen.SchemaIdManager.IdFor(Type type) 3 at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.CreateReferenceSchema(Type type, Queue`1 referencedTypes) 4 at Swashbuckle.AspNetCore.SwaggerGen.SchemaRegistry.GetOrRegister(Type type) 5 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateParameter(ApiDescription apiDescription, ApiParameterDescription apiParameterDescription, ISchemaRegistry schemaRegistry) 6 at System.Linq.Enumerable.WhereSelectListIterator`2.ToList() 7 at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 8 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, ISchemaRegistry schemaRegistry) 9 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable`1 apiDescriptions, ISchemaRegistry schemaRegistry) 10 at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) 11 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItems(IEnumerable`1 apiDescriptions, ISchemaRegistry schemaRegistry) 12 at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath, String[] schemes) 13 at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext) 14 at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) 15 at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) 16 at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) 17 at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) 18 at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() 19 --- End of stack trace from previous location where exception was thrown --- 20 at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) 21 at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context) 22 at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Security\AbpSecurityHeadersMiddleware.cs:line 26 23 at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext) 24 at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
主要緣由是由於兩個類有相同的名稱但出如今了不一樣的全名空間!因此會報錯,解決辦法以下:app