Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 239 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
# RSCG - 240 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 239 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 240 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.

This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem

## Latest Update : 2025-11-08 => 08 November 2025
## Latest Update : 2025-11-09 => 09 November 2025

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -24,8 +24,32 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 239 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 15 from Microsoft )
Those are the 240 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 240. [XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator) , in the [API](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) category

Generated on : 2025-11-09 => 09 November 2025

<details>
<summary>Expand</summary>



Author: Microsoft

Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations.

This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436

Nuget: [https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator)

Source: [https://github.com/dotnet/dotnet/](https://github.com/dotnet/dotnet/)

</details>

### 239. [TUnit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category

Generated on : 2025-11-08 => 08 November 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-11-08 => 08 November 2025
## Latest Update : 2025-11-09 => 09 November 2025



Expand Down
30 changes: 30 additions & 0 deletions v2/.tours/XmlCommentGenerator.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "XmlCommentGenerator",
"steps":
[
{
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj",
"description": "First, we add Nuget [Microsoft.AspNetCore.OpenApi](https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/) in csproj ",
"pattern": "Microsoft.AspNetCore.OpenApi"
}

,{
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/XmlCommentGenerator/src/TestProgram/TestProgram.csproj ",
"pattern": "this is the code"
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern property value "this is the code" does not match any actual code in Program.cs. This pattern is used for CodeTour navigation and should match actual code text in the file, such as "using System.Text.Json.Serialization" or another distinctive line from the file.

Suggested change
"pattern": "this is the code"
"pattern": "using System;"

Copilot uses AI. Check for mistakes.
}


,{
"file": "rscg_examples/XmlCommentGenerator/src/TestProgram/obj/GX/Microsoft.AspNetCore.OpenApi.SourceGenerators/Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator/OpenApiXmlCommentSupport.generated.cs",
"description": "Generated File 1 from 1 : OpenApiXmlCommentSupport.generated.cs ",
"line": 1
}

],

"ref": "main"

}
Comment on lines +5 to +30
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# List all .tour files to understand the structure
find . -name "*.tour" -type f | head -20

Repository: ignatandrei/RSCG_Examples

Length of output: 1214


🏁 Script executed:

#!/bin/bash
# Check the specific Program.cs file mentioned
if [ -f "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs" ]; then
  echo "=== File exists at v2/ path ==="
  wc -l "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
  cat -n "v2/rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
elif [ -f "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs" ]; then
  echo "=== File exists at rscg_examples/ path (no v2) ==="
  wc -l "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
  cat -n "rscg_examples/XmlCommentGenerator/src/TestProgram/Program.cs"
else
  echo "=== File not found at either path ==="
fi

Repository: ignatandrei/RSCG_Examples

Length of output: 1856


🏁 Script executed:

#!/bin/bash
# Check another .tour file to see path convention
if [ -f "v2/.tours" ]; then
  ls -la v2/.tours/ | head -10
  echo ""
  echo "=== Checking a sample .tour file for path convention ==="
  find v2/.tours -name "*.tour" -type f | head -1 | xargs head -30
fi

Repository: ignatandrei/RSCG_Examples

Length of output: 51


🏁 Script executed:

#!/bin/bash
# Read the XmlCommentGenerator.tour file
echo "=== XmlCommentGenerator.tour content ==="
cat v2/.tours/XmlCommentGenerator.tour

echo ""
echo "=== Program.tour (sample top-level tour) ==="
head -40 v2/.tours/Program.tour

echo ""
echo "=== TUnit.tour (another sample top-level tour) ==="
head -40 v2/.tours/TUnit.tour

Repository: ignatandrei/RSCG_Examples

Length of output: 3958


🏁 Script executed:

#!/bin/bash
# Check a nested tour file for comparison
echo "=== Sample nested tour file for path convention ==="
head -40 v2/rscg_examples/ActorSrcGen/src/.tours/ActorSrcGen.tour

Repository: ignatandrei/RSCG_Examples

Length of output: 1161


The pattern issue is systemic across all .tour files; path convention is correct

The review's concern about paths is incorrect. All top-level .tour files in v2/.tours/ consistently use rscg_examples/... without the v2/ prefix, which is the established convention across the entire repository. This path format is correct and matches Program.tour, TUnit.tour, and all other samples.

However, the pattern issue is valid but far broader than stated: The string "this is the code" appears as a placeholder pattern in virtually every second step across all .tour files in the repository (not just XmlCommentGenerator). This is a systemic issue, not specific to this file. All these tours use this placeholder, suggesting it's a template artifact rather than an intentional pattern.

Recommendation: The pattern should be replaced with an actual code snippet from the respective file (e.g., WebApplication.CreateSlimBuilder for XmlCommentGenerator.tour's Program.cs step, as originally suggested). This is part of a broader tour maintenance task affecting multiple files.

1 change: 1 addition & 0 deletions v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public string[] SourceNoRSCG()
text = text.Replace("(di.gif)", $"({d.Generator!.Source}/di.gif)");

text = text.Replace("(./docs/", $"({d.Generator!.Source}/docs/");
text = text.Replace("(/docs/", $"({d.Generator!.Source}/docs/");

text = text.Replace("(doc/", $"({d.Generator!.Source}/doc/");
text = text.Replace("(docs/rules/", $"({d.Generator!.Source}/docs/rules/");
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,4 @@ Nr,Key,Source,Category
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
239,TUnit, https://github.com/thomhurst/TUnit,Tests
240,XmlCommentGenerator, https://github.com/dotnet/dotnet/,API
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1447,5 +1447,11 @@
"Category":13,
"dtStart": "2025-11-08T00:00:00",
"show": true
},
{
"ID":"XmlCommentGenerator",
"Category":15,
"dtStart": "2025-11-09T00:00:00",
"show": true
}
]
53 changes: 53 additions & 0 deletions v2/book/examples/XmlCommentGenerator.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

<h1>RSCG nr 240 : XmlCommentGenerator</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/</a>

<p>You can find more details at : <a href="https://dotnet.microsoft.com/en-us/apps/aspnet" target="_blank"> https://dotnet.microsoft.com/en-us/apps/aspnet</a></p>

<p>Author :Microsoft</p>

<p>Source: <a href="https://github.com/dotnet/dotnet/" target="_blank">https://github.com/dotnet/dotnet/</a> </p>

<h2>About</h2>

Adding Xml comments to generated OpenAPI documentation

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/" target="_blank">XmlCommentGenerator</a> in the csproj
</h3>
<img src="images/XmlCommentGenerator/TestProgram.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/XmlCommentGenerator/csFiles/Program.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is OpenApiXmlCommentSupport.generated.cs
<br />
<img src="images/XmlCommentGenerator/generated/OpenApiXmlCommentSupport.generated.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 239 RSCG with examples =>
This is the list of 240 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -982,6 +982,10 @@ <h1>
<td>239</td>
<td><a href="examples/TUnit.html">TUnit</a></td>
</tr>
<tr>
<td>240</td>
<td><a href="examples/XmlCommentGenerator.html">XmlCommentGenerator</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ input-files:
- examples/Program.html
- examples/TeCLI.html
- examples/TUnit.html
- examples/XmlCommentGenerator.html

# or you may use input-file: with a single value
# defaults:
Expand Down
24 changes: 24 additions & 0 deletions v2/rscg_examples/XmlCommentGenerator/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"generator":{
"name":"XmlCommentGenerator",
"nuget":[
"https://www.nuget.org/packages/Microsoft.AspNetCore.OpenApi/"
],
"link":"https://dotnet.microsoft.com/en-us/apps/aspnet",
"author":"Microsoft",
"source":"https://github.com/dotnet/dotnet/"
},
"data":{
"goodFor":["Adding Xml comments to generated OpenAPI documentation"],
"csprojDemo":"TestProgram.csproj",
"csFiles":["Program.cs"],
"excludeDirectoryGenerated":["Microsoft.AspNetCore.App.SourceGenerators",
"Microsoft.AspNetCore.Http.RequestDelegateGenerator",
"System.Text.Json.SourceGeneration"],
Comment on lines +15 to +17
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect indentation for array items. Lines 16-17 should be indented to align with line 15. The current indentation breaks the JSON structure and makes it inconsistent.

Suggested change
"excludeDirectoryGenerated":["Microsoft.AspNetCore.App.SourceGenerators",
"Microsoft.AspNetCore.Http.RequestDelegateGenerator",
"System.Text.Json.SourceGeneration"],
"excludeDirectoryGenerated":[
"Microsoft.AspNetCore.App.SourceGenerators",
"Microsoft.AspNetCore.Http.RequestDelegateGenerator",
"System.Text.Json.SourceGeneration"
],

Copilot uses AI. Check for mistakes.
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
3 changes: 3 additions & 0 deletions v2/rscg_examples/XmlCommentGenerator/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Provides APIs for annotating route handler endpoints in ASP.NET Core with OpenAPI annotations.

This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436
Loading
Loading