Note: This applies to .net 6 LTS
- Turn on XML Documentation generation in the project in Properties-Build-Output select Documentation File
- Modify the
AddSwaggerGenline in theprogram.csfile
builder.Services.AddSwaggerGen( c =>
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory,
$"{Assembly.GetExecutingAssembly().GetName().Name}.xml")));Note: This assumes that you are creating the xml documentation file in the default location and picking it up from there.