diff --git a/Source/Boxed.AspNetCore.Swagger/SwaggerGenOptionsExtensions.cs b/Source/Boxed.AspNetCore.Swagger/SwaggerGenOptionsExtensions.cs index ec41b0a5..9bcf614a 100644 --- a/Source/Boxed.AspNetCore.Swagger/SwaggerGenOptionsExtensions.cs +++ b/Source/Boxed.AspNetCore.Swagger/SwaggerGenOptionsExtensions.cs @@ -31,8 +31,11 @@ public static SwaggerGenOptions IncludeXmlCommentsIfExists(this SwaggerGenOption throw new ArgumentNullException(nameof(assembly)); } - var filePath = Path.ChangeExtension(assembly.Location, ".xml"); - IncludeXmlCommentsIfExists(options, filePath); + if (!string.IsNullOrEmpty(assembly.Location)) + { + var filePath = Path.ChangeExtension(assembly.Location, ".xml"); + IncludeXmlCommentsIfExists(options, filePath); + } return options; }