diff --git a/README.md b/README.md index 086db9424..d86a16949 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# RSCG - 248 Examples of Roslyn Source Code Generators / 16 created by Microsoft / +# RSCG - 249 Examples of Roslyn Source Code Generators / 16 created by Microsoft / -The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 248 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 249 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-12-15 => 15 December 2025 +## Latest Update : 2025-12-16 => 16 December 2025 If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)*** @@ -12,7 +12,7 @@ If you want just those from Microsoft, please click ***[Microsoft](https://ignat If you want to see by category, please click ***[category](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples)*** or click any category below -[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[bool](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bool) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mcp](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) - +[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[bool](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bool) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mcp](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[profiler](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#profiler) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) - ## If you have a Roslyn Source Code Generator, please create an issue. @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt ## Content -Those are the 248 Roslyn Source Code Generators that I have tested you can see and download source code example. +Those are the 249 Roslyn Source Code Generators that I have tested you can see and download source code example. ( including 16 from Microsoft ) +### 249. [Silhouette](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette) , in the [Profiler](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#profiler) category + +Generated on : 2025-12-16 => 16 December 2025 + +
+ Expand + + + +Author: Kevin Gosse + +A library to build .NET profilers in .NET. No need for C++ anymore, just C#. + +Nuget: [https://www.nuget.org/packages/Silhouette/](https://www.nuget.org/packages/Silhouette/) + + +Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette) + +Source: [https://github.com/kevingosse/Silhouette](https://github.com/kevingosse/Silhouette) + +
+ ### 248. [docopt.net](https://ignatandrei.github.io/RSCG_Examples/v2/docs/docopt.net) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category Generated on : 2025-12-15 => 15 December 2025 @@ -2142,7 +2164,7 @@ Generated on : 2024-08-01 => 01 August 2024 -Author: AndreiIgnat +Author: Ignat Andrei Roslyn Diagram generator for external dependencies diff --git a/later.md b/later.md index 08dde32dd..a9effcebd 100644 --- a/later.md +++ b/later.md @@ -1,6 +1,6 @@ # Just later -## Latest Update : 2025-12-15 => 15 December 2025 +## Latest Update : 2025-12-16 => 16 December 2025 diff --git a/v2/.tours/Silhouette.tour b/v2/.tours/Silhouette.tour new file mode 100644 index 000000000..9e1c7677e --- /dev/null +++ b/v2/.tours/Silhouette.tour @@ -0,0 +1,30 @@ + +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "Silhouette", + "steps": + [ + { + "file": "rscg_examples/Silhouette/src/ProfilerDemo/ProfilerDemo.csproj", + "description": "First, we add Nuget [Silhouette](https://www.nuget.org/packages/Silhouette/) in csproj ", + "pattern": "Silhouette" + } + + ,{ + "file": "rscg_examples/Silhouette/src/ProfilerDemo/Program.cs", + "description": "File Program.cs \r\n>> dotnet run --project rscg_examples/Silhouette/src/ProfilerDemo/ProfilerDemo.csproj ", + "pattern": "this is the code" + } + + + ,{ + "file": "rscg_examples/Silhouette/src/ProfilerDemo/obj/GX/Silhouette.SourceGenerator/Silhouette.SourceGenerator.ProfilerAttributeSourceGenerator/silhouette.dllmain.g.cs", + "description": "Generated File 1 from 1 : silhouette.dllmain.g.cs ", + "line": 1 + } + + ], + + "ref": "main" + +} \ No newline at end of file diff --git a/v2/Generator/all.csv b/v2/Generator/all.csv index 3cf20b6aa..c060238c1 100644 --- a/v2/Generator/all.csv +++ b/v2/Generator/all.csv @@ -247,3 +247,4 @@ Nr,Key,Source,Category 246,Imposter, https://github.com/themidnightgospel/Imposter,Tests 247,BlazorOcticons, https://github.com/BlazorOcticons/BlazorOcticons,Blazor 248,docopt.net, https://github.com/docopt/docopt.net,CommandLine +249,Silhouette, https://github.com/kevingosse/Silhouette,Profiler diff --git a/v2/GeneratorData/Category.cs b/v2/GeneratorData/Category.cs index 2df354dbc..4b659dde7 100644 --- a/v2/GeneratorData/Category.cs +++ b/v2/GeneratorData/Category.cs @@ -45,6 +45,7 @@ public enum Category Validator=40, Decorator= 41, MCP= 42, - Bool=43 + Bool=43, + Profiler=44, } diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index 51ef09651..d013a1982 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1503,5 +1503,11 @@ "Category": 32, "dtStart": "2025-12-15T00:00:00", "show": true + }, + { + "ID":"Silhouette", + "Category": 44, + "dtStart": "2025-12-16T00:00:00", + "show": true } ] \ No newline at end of file diff --git a/v2/book/examples/Silhouette.html b/v2/book/examples/Silhouette.html new file mode 100644 index 000000000..8f663e7a8 --- /dev/null +++ b/v2/book/examples/Silhouette.html @@ -0,0 +1,53 @@ + +

RSCG nr 249 : Silhouette

+ +

Info

+Nuget : https://www.nuget.org/packages/Silhouette/ + +

You can find more details at : https://github.com/kevingosse/Silhouette

+ +

Author :Kevin Gosse

+ +

Source: https://github.com/kevingosse/Silhouette

+ +

About

+ +Profiling .net applicationsMeasuring performance improvements + +

+ How to use +

+

+ Add reference to the Silhouette in the csproj +

+ + +

This was for me the starting code

+ +
+ I have coded the file Program.cs +
+ +
+

And here are the generated files

+ +
+ The file generated is silhouette.dllmain.g.cs +
+ + +

+ You can download the code and this page as pdf from + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette + +

+ + +

+ You can see the whole list at + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG + +

+ diff --git a/v2/book/list.html b/v2/book/list.html index b7307e7ce..a2fa0391e 100644 --- a/v2/book/list.html +++ b/v2/book/list.html @@ -17,7 +17,7 @@

-This is the list of 248 RSCG with examples => +This is the list of 249 RSCG with examples =>

@@ -1018,6 +1018,10 @@

+ + + +
248 docopt.net
249Silhouette
diff --git a/v2/book/pandocHTML.yaml b/v2/book/pandocHTML.yaml index 36dd96b61..440c9ae72 100644 --- a/v2/book/pandocHTML.yaml +++ b/v2/book/pandocHTML.yaml @@ -262,6 +262,7 @@ input-files: - examples/Imposter.html - examples/BlazorOcticons.html - examples/docopt.net.html +- examples/Silhouette.html # or you may use input-file: with a single value # defaults: diff --git a/v2/rscg_examples/RSCG_ExportDiagram/description.json b/v2/rscg_examples/RSCG_ExportDiagram/description.json index aa77c4b4f..6606ce6e3 100644 --- a/v2/rscg_examples/RSCG_ExportDiagram/description.json +++ b/v2/rscg_examples/RSCG_ExportDiagram/description.json @@ -5,7 +5,7 @@ "https://github.com/ignatandrei/RSCG_ExportDiagram" ], "link":"RSCG_ExportDiagram", - "author":"AndreiIgnat", + "author":"Ignat Andrei", "source":"https://github.com/ignatandrei/RSCG_ExportDiagram" }, "data":{ diff --git a/v2/rscg_examples/Silhouette/description.json b/v2/rscg_examples/Silhouette/description.json new file mode 100644 index 000000000..e75a476e4 --- /dev/null +++ b/v2/rscg_examples/Silhouette/description.json @@ -0,0 +1,22 @@ +{ + "generator":{ + "name":"Silhouette", + "nuget":[ + "https://www.nuget.org/packages/Silhouette/" + ], + "link":"https://github.com/kevingosse/Silhouette", + "author":"Kevin Gosse", + "source":"https://github.com/kevingosse/Silhouette" + }, + "data":{ + "goodFor":["Profiling .net applications","Measuring performance improvements"], + "csprojDemo":"ProfilerDemo.csproj", + "csFiles":["Program.cs"], + "excludeDirectoryGenerated":["NativeObjects"], + "includeAdditionalFiles":[""] + }, + "links":{ + "blog":"", + "video":"" + } +} \ No newline at end of file diff --git a/v2/rscg_examples/Silhouette/nuget.txt b/v2/rscg_examples/Silhouette/nuget.txt new file mode 100644 index 000000000..37f3c8f5e --- /dev/null +++ b/v2/rscg_examples/Silhouette/nuget.txt @@ -0,0 +1 @@ +A library to build .NET profilers in .NET. No need for C++ anymore, just C#. \ No newline at end of file diff --git a/v2/rscg_examples/Silhouette/readme.txt b/v2/rscg_examples/Silhouette/readme.txt new file mode 100644 index 000000000..24728494f --- /dev/null +++ b/v2/rscg_examples/Silhouette/readme.txt @@ -0,0 +1,86 @@ +Silhouette - A library to build .NET profilers in .NET +======================= + +# Quick start + +Create a new C# NativeAOT project. Reference the Silhouette nuget package and add a class inheriting from `Silhouette.CorProfilerCallback11Base` (you can use a different version of `CorProfilerCallbackBase` depending on the version of .NET you're targeting). Override the `Initialize` method. It will be called with the highest version number of `ICorProfilerInfo` supported by the target runtime. + +```csharp + +using Silhouette; + +[Profiler("0A96F866-D763-4099-8E4E-ED1801BE9FBC")] // Use your own profiler GUID here +internal partial class CorProfilerCallback : CorProfilerCallback11Base +{ + protected override HResult Initialize(int iCorProfilerInfoVersion) + { + if (iCorProfilerInfoVersion < 11) + { + return HResult.E_FAIL; + } + + var result = ICorProfilerInfo11.SetEventMask(COR_PRF_MONITOR.COR_PRF_ENABLE_STACK_SNAPSHOT | COR_PRF_MONITOR.COR_PRF_MONITOR_THREADS); + + return result; + } +} +``` + +The `Profiler` attribute triggers a source-generator that emits the proper `DllGetClassObject` function and validates that the user is using the matching guid for the profiler. Alternatively, you can manually implement a `DllGetClassObject` method that will be called by the .NET runtime when initializing the profiler. Use the built-in `ClassFactory` implementation and give it an instance of your `CorProfiler` class. + +```csharp +using Silhouette; +using System.Runtime.InteropServices; + +internal class DllMain +{ + // This code is automatically generated when using the `[Profiler]` attribute on `CorProfilerCallback` + [UnmanagedCallersOnly(EntryPoint = "DllGetClassObject")] + public static unsafe HResult DllGetClassObject(Guid* rclsid, Guid* riid, nint* ppv) + { + // Use your own profiler GUID here + if (*rclsid != new Guid("0A96F866-D763-4099-8E4E-ED1801BE9FBC")) + { + return HResult.CORPROF_E_PROFILER_CANCEL_ACTIVATION; + } + + *ppv = ClassFactory.For(new CorProfilerBase()); + + return HResult.S_OK; + } +} +``` + +`CorProfilerXxBase` offers base virtual methods for all `ICorProfilerCallback` methods, so override the ones you're interested in: + +```csharp + protected override HResult ThreadCreated(ThreadId threadId) + { + Console.WriteLine($"Thread created: {threadId.Value}"); + return HResult.S_OK; + } +``` + +Use the `ICorProfilerInfoXx` fields to access the `ICorProfilerInfo` APIs: + +```csharp + private unsafe string ResolveMethodName(nint ip) + { + try + { + var functionId = ICorProfilerInfo11.GetFunctionFromIP(ip).ThrowIfFailed(); + var functionInfo = ICorProfilerInfo2.GetFunctionInfo(functionId).ThrowIfFailed(); + using var metaDataImport = ICorProfilerInfo2.GetModuleMetaDataImport(functionInfo.ModuleId, CorOpenFlags.ofRead).ThrowIfFailed().Wrap(); + var methodProperties = metaDataImport.Value.GetMethodProps(new MdMethodDef(functionInfo.Token)).ThrowIfFailed(); + var typeDefProps = metaDataImport.Value.GetTypeDefProps(methodProperties.Class).ThrowIfFailed(); + + return $"{typeDefProps.TypeName}.{methodProperties.Name}"; + } + catch (Win32Exception) + { + return ""; + } + } +``` + +Most methods return an instance of `HResult`. You can deconstruct it into a `(HResult error, T result)` and manually check the error code. You can also use the `ThrowIfFailed()` method that will return only the result and throw a `Win32Exception` if the error code is not `S_OK`. diff --git a/v2/rscg_examples/Silhouette/src/ProfilerDemo.slnx b/v2/rscg_examples/Silhouette/src/ProfilerDemo.slnx new file mode 100644 index 000000000..f352fe662 --- /dev/null +++ b/v2/rscg_examples/Silhouette/src/ProfilerDemo.slnx @@ -0,0 +1,3 @@ + + + diff --git a/v2/rscg_examples/Silhouette/src/ProfilerDemo/MyProfiler.cs b/v2/rscg_examples/Silhouette/src/ProfilerDemo/MyProfiler.cs new file mode 100644 index 000000000..708ef1d73 --- /dev/null +++ b/v2/rscg_examples/Silhouette/src/ProfilerDemo/MyProfiler.cs @@ -0,0 +1,52 @@ +using Silhouette; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace ProfilerDemo; + +[Profiler("8AD62131-BF21-47C1-A4D4-3AEF5D7C75C6")] +internal class MyProfiler : CorProfilerCallback5Base +{ + protected override HResult Initialize(int iCorProfilerInfoVersion) + { + Console.WriteLine("[SilhouetteProf] Initialize"); + if (iCorProfilerInfoVersion < 5) + { + // we need at least ICorProfilerInfo5 and we got < 5 + return HResult.E_FAIL; + } + + // Call SetEventMask to tell the .NET runtime which events we're interested in + return ICorProfilerInfo5.SetEventMask(COR_PRF_MONITOR.COR_PRF_MONITOR_ALL); + } + protected override HResult ClassLoadStarted(ClassId classId) + { + try + { + ClassIdInfo classIdInfo = ICorProfilerInfo.GetClassIdInfo(classId).ThrowIfFailed(); + + using ComPtr? metaDataImport = ICorProfilerInfo2 + .GetModuleMetaDataImport(classIdInfo.ModuleId, CorOpenFlags.ofRead) + .ThrowIfFailed() + .Wrap(); + TypeDefPropsWithName classProps = metaDataImport.Value.GetTypeDefProps(classIdInfo.TypeDef).ThrowIfFailed(); + + Console.WriteLine($"[SilhouetteProf] ClassLoadStarted: {classProps.TypeName}"); + return HResult.S_OK; + } + catch (Win32Exception ex) + { + Console.WriteLine($"[SilhouetteProf] ClassLoadStarted failed: {ex}"); + return ex.NativeErrorCode; + } + + } + protected override HResult Shutdown() + { + Console.WriteLine("[SilhouetteProf] Shutdown"); + return HResult.S_OK; + } + +} diff --git a/v2/rscg_examples/Silhouette/src/ProfilerDemo/ProfilerDemo.csproj b/v2/rscg_examples/Silhouette/src/ProfilerDemo/ProfilerDemo.csproj new file mode 100644 index 000000000..55c81a49f --- /dev/null +++ b/v2/rscg_examples/Silhouette/src/ProfilerDemo/ProfilerDemo.csproj @@ -0,0 +1,21 @@ + + + + Exe + net10.0 + enable + enable + true + true + + + + + + + + true + $(BaseIntermediateOutputPath)\GX + + + diff --git a/v2/rscg_examples/Silhouette/src/ProfilerDemo/Program.cs b/v2/rscg_examples/Silhouette/src/ProfilerDemo/Program.cs new file mode 100644 index 000000000..ff62075dc --- /dev/null +++ b/v2/rscg_examples/Silhouette/src/ProfilerDemo/Program.cs @@ -0,0 +1,2 @@ +// See https://andrewlock.net/creating-a-dotnet-profiler-using-csharp-with-silhouette/ +Console.WriteLine("Please read https://andrewlock.net/creating-a-dotnet-profiler-using-csharp-with-silhouette/"); diff --git a/v2/rscg_examples/Silhouette/video.json b/v2/rscg_examples/Silhouette/video.json new file mode 100644 index 000000000..073948de0 --- /dev/null +++ b/v2/rscg_examples/Silhouette/video.json @@ -0,0 +1,39 @@ +{ + "scriptName": "Silhouette", + "steps": +[ + {"typeStep":"exec","arg":"clipchamp.exe launch"}, + {"typeStep":"text","arg": "Welcome to Roslyn Examples"}, + {"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"}, + {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, + {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, + +{"typeStep":"text","arg": "Today I will present Silhouette . Profiling .net applicationsMeasuring performance improvements ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/Silhouette/"}, +{"typeStep":"text","arg": "The whole example is here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette"}, +{"typeStep":"text","arg": "You can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette#download-example-net--c-"}, +{"typeStep":"text","arg":"Here is the code downloaded "}, +{"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\Generator.sln"}, +{"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, +{"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2"}, + +{"typeStep":"text","arg": "To use it ,you will put the Nuget Silhouette into the csproj "}, + +{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Silhouette\\src\\ProfilerDemo\\ProfilerDemo.csproj"}, + +{"typeStep":"text","arg": "And now I will show you an example of using Silhouette"}, + +{"typeStep":"hide","arg": "now execute the tour in VSCode"}, +{"typeStep":"tour", "arg": "src/.tours/"}, +{"typeStep":"text","arg":" And I will execute the project"}, +{"typeStep":"showproj", "arg":"ProfilerDemo.csproj"}, +{"typeStep":"text","arg":" This concludes the project"}, +{"typeStep":"waitseconds","arg":"30"}, +{"typeStep":"text","arg": "Remember, you can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette#download-example-net--c-", +SpeakTest=" "}, +{"typeStep":"waitseconds","arg":"30"}, +] +} diff --git a/v2/rscg_examples_site/docs/Authors/Ignat_Andrei.md b/v2/rscg_examples_site/docs/Authors/Ignat_Andrei.md index ee2ac21c9..bdc5b3a91 100644 --- a/v2/rscg_examples_site/docs/Authors/Ignat_Andrei.md +++ b/v2/rscg_examples_site/docs/Authors/Ignat_Andrei.md @@ -1,6 +1,6 @@ # Author : Ignat Andrei -Number RSCG: 23 +Number RSCG: 24 1 [RSCG_TimeBombComment](/docs/RSCG_TimeBombComment) [![Nuget](https://img.shields.io/nuget/dt/RSCG_TimeBombComment?label=RSCG_TimeBombComment)](https://www.nuget.org/packages/RSCG_TimeBombComment/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_TimeBombComment?style=social) 2023-04-16 @@ -35,17 +35,19 @@ Number RSCG: 23 16 [RSCG_IFormattable](/docs/RSCG_IFormattable) [![Nuget](https://img.shields.io/nuget/dt/RSCG_IFormattable?label=RSCG_IFormattable)](https://www.nuget.org/packages/RSCG_IFormattable/)[![Nuget](https://img.shields.io/nuget/dt/RSCG_IFormattableCommon?label=RSCG_IFormattableCommon)](https://www.nuget.org/packages/RSCG_IFormattableCommon/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_iformattable?style=social) 2024-06-29 - 17 [RSCG_NameGenerator](/docs/RSCG_NameGenerator) [![Nuget](https://img.shields.io/nuget/dt/RSCG_NameGenerator?label=RSCG_NameGenerator)](https://www.nuget.org/packages/RSCG_NameGenerator/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/NameGenerator?style=social) 2024-08-25 + 17 [RSCG_ExportDiagram](/docs/RSCG_ExportDiagram) [![Nuget](https://img.shields.io/nuget/dt/RSCG_ExportDiagram?label=RSCG_ExportDiagram)](https://github.com/ignatandrei/RSCG_ExportDiagram) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_ExportDiagram?style=social) 2024-08-01 - 18 [rscg_queryables](/docs/rscg_queryables) [![Nuget](https://img.shields.io/nuget/dt/rscg_queryables?label=rscg_queryables)](https://www.nuget.org/packages/rscg_queryables/)[![Nuget](https://img.shields.io/nuget/dt/rscg_queryablesCommon?label=rscg_queryablesCommon)](https://www.nuget.org/packages/rscg_queryablesCommon/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_queryables?style=social) 2024-11-02 + 18 [RSCG_NameGenerator](/docs/RSCG_NameGenerator) [![Nuget](https://img.shields.io/nuget/dt/RSCG_NameGenerator?label=RSCG_NameGenerator)](https://www.nuget.org/packages/RSCG_NameGenerator/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/NameGenerator?style=social) 2024-08-25 - 19 [rscg_Interface_to_null_object](/docs/rscg_Interface_to_null_object) [![Nuget](https://img.shields.io/nuget/dt/rscg_Interface_to_null_object?label=rscg_Interface_to_null_object)](https://www.nuget.org/packages/rscg_Interface_to_null_object/)[![Nuget](https://img.shields.io/nuget/dt/rscg_Interface_to_null_object_common?label=rscg_Interface_to_null_object_common)](https://www.nuget.org/packages/rscg_Interface_to_null_object_common) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_Interface_to_null_object?style=social) 2025-01-18 + 19 [rscg_queryables](/docs/rscg_queryables) [![Nuget](https://img.shields.io/nuget/dt/rscg_queryables?label=rscg_queryables)](https://www.nuget.org/packages/rscg_queryables/)[![Nuget](https://img.shields.io/nuget/dt/rscg_queryablesCommon?label=rscg_queryablesCommon)](https://www.nuget.org/packages/rscg_queryablesCommon/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_queryables?style=social) 2024-11-02 - 20 [RSCG_CompositeProvider](/docs/RSCG_CompositeProvider) [![Nuget](https://img.shields.io/nuget/dt/RSCG_CompositeProvider?label=RSCG_CompositeProvider)](https://www.nuget.org/packages/RSCG_CompositeProvider/)[![Nuget](https://img.shields.io/nuget/dt/RSCG_CompositeProvider_common?label=RSCG_CompositeProvider_common)](https://www.nuget.org/packages/RSCG_CompositeProvider_common/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_CompositeProvider?style=social) 2025-02-18 + 20 [rscg_Interface_to_null_object](/docs/rscg_Interface_to_null_object) [![Nuget](https://img.shields.io/nuget/dt/rscg_Interface_to_null_object?label=rscg_Interface_to_null_object)](https://www.nuget.org/packages/rscg_Interface_to_null_object/)[![Nuget](https://img.shields.io/nuget/dt/rscg_Interface_to_null_object_common?label=rscg_Interface_to_null_object_common)](https://www.nuget.org/packages/rscg_Interface_to_null_object_common) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_Interface_to_null_object?style=social) 2025-01-18 - 21 [rscg_demeter](/docs/rscg_demeter) [![Nuget](https://img.shields.io/nuget/dt/rscg_demeter?label=rscg_demeter)](https://www.nuget.org/packages/rscg_demeter/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_demeter?style=social) 2025-03-26 + 21 [RSCG_CompositeProvider](/docs/RSCG_CompositeProvider) [![Nuget](https://img.shields.io/nuget/dt/RSCG_CompositeProvider?label=RSCG_CompositeProvider)](https://www.nuget.org/packages/RSCG_CompositeProvider/)[![Nuget](https://img.shields.io/nuget/dt/RSCG_CompositeProvider_common?label=RSCG_CompositeProvider_common)](https://www.nuget.org/packages/RSCG_CompositeProvider_common/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_CompositeProvider?style=social) 2025-02-18 - 22 [RSCG_MCP2OpenAPI](/docs/RSCG_MCP2OpenAPI) [![Nuget](https://img.shields.io/nuget/dt/RSCG_MCP2OpenAPI?label=RSCG_MCP2OpenAPI)](https://www.nuget.org/packages/RSCG_MCP2OpenAPI/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_OpenApi2MCP?style=social) 2025-11-11 + 22 [rscg_demeter](/docs/rscg_demeter) [![Nuget](https://img.shields.io/nuget/dt/rscg_demeter?label=rscg_demeter)](https://www.nuget.org/packages/rscg_demeter/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/rscg_demeter?style=social) 2025-03-26 - 23 [RSCG_MCP2File](/docs/RSCG_MCP2File) [![Nuget](https://img.shields.io/nuget/dt/RSCG_MCP2File?label=RSCG_MCP2File)](https://www.nuget.org/packages/RSCG_MCP2File/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_OpenApi2MCP?style=social) 2025-11-15 + 23 [RSCG_MCP2OpenAPI](/docs/RSCG_MCP2OpenAPI) [![Nuget](https://img.shields.io/nuget/dt/RSCG_MCP2OpenAPI?label=RSCG_MCP2OpenAPI)](https://www.nuget.org/packages/RSCG_MCP2OpenAPI/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_OpenApi2MCP?style=social) 2025-11-11 + + 24 [RSCG_MCP2File](/docs/RSCG_MCP2File) [![Nuget](https://img.shields.io/nuget/dt/RSCG_MCP2File?label=RSCG_MCP2File)](https://www.nuget.org/packages/RSCG_MCP2File/) ![GitHub Repo stars](https://img.shields.io/github/stars/ignatandrei/RSCG_OpenApi2MCP?style=social) 2025-11-15 diff --git a/v2/rscg_examples_site/docs/Authors/Kevin_Gosse.md b/v2/rscg_examples_site/docs/Authors/Kevin_Gosse.md index 12557449b..b910cb9f8 100644 --- a/v2/rscg_examples_site/docs/Authors/Kevin_Gosse.md +++ b/v2/rscg_examples_site/docs/Authors/Kevin_Gosse.md @@ -1,7 +1,9 @@ # Author : Kevin Gosse -Number RSCG: 1 +Number RSCG: 2 1 [NativeObjects](/docs/NativeObjects) [![Nuget](https://img.shields.io/nuget/dt/NativeObjects?label=NativeObjects)](https://www.nuget.org/packages/NativeObjects/) ![GitHub Repo stars](https://img.shields.io/github/stars/kevingosse/NativeObjects?style=social) 2025-03-28 + 2 [Silhouette](/docs/Silhouette) [![Nuget](https://img.shields.io/nuget/dt/Silhouette?label=Silhouette)](https://www.nuget.org/packages/Silhouette/) ![GitHub Repo stars](https://img.shields.io/github/stars/kevingosse/Silhouette?style=social) 2025-12-16 + diff --git a/v2/rscg_examples_site/docs/Categories/Profiler.md b/v2/rscg_examples_site/docs/Categories/Profiler.md new file mode 100644 index 000000000..d1f6a05c2 --- /dev/null +++ b/v2/rscg_examples_site/docs/Categories/Profiler.md @@ -0,0 +1,6 @@ +

Profiler

+ +Number RSCG: 1 + + 1 [Silhouette](/docs/Silhouette) [![Nuget](https://img.shields.io/nuget/dt/Silhouette?label=Silhouette)](https://www.nuget.org/packages/Silhouette/) ![GitHub Repo stars](https://img.shields.io/github/stars/kevingosse/Silhouette?style=social) 2025-12-16 + \ No newline at end of file diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveProfiler.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveProfiler.mdx new file mode 100644 index 000000000..514a154fd --- /dev/null +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveProfiler.mdx @@ -0,0 +1,7 @@ +### Category "Profiler" has the following generators: + + 1 [Silhouette](/docs/Silhouette) [![Nuget](https://img.shields.io/nuget/dt/Silhouette?label=Silhouette)](https://www.nuget.org/packages/Silhouette/) ![GitHub Repo stars](https://img.shields.io/github/stars/kevingosse/Silhouette?style=social) 2025-12-16 + +### See category + +[Profiler](/docs/Categories/Profiler) diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/Silhouette.md b/v2/rscg_examples_site/docs/RSCG-Examples/Silhouette.md new file mode 100644 index 000000000..8c9c54295 --- /dev/null +++ b/v2/rscg_examples_site/docs/RSCG-Examples/Silhouette.md @@ -0,0 +1,258 @@ +--- +sidebar_position: 2490 +title: 249 - Silhouette +description: Profiling .net applications +slug: /Silhouette +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TOCInline from '@theme/TOCInline'; +import SameCategory from '../Categories/_PrimitiveProfiler.mdx'; + +# Silhouette by Kevin Gosse + + + + +## NuGet / site data +[![Nuget](https://img.shields.io/nuget/dt/Silhouette?label=Silhouette)](https://www.nuget.org/packages/Silhouette/) +[![GitHub last commit](https://img.shields.io/github/last-commit/kevingosse/Silhouette?label=updated)](https://github.com/kevingosse/Silhouette) +![GitHub Repo stars](https://img.shields.io/github/stars/kevingosse/Silhouette?style=social) + +## Details + +### Info +:::info + +Name: **Silhouette** + +A library to build .NET profilers in .NET. No need for C++ anymore, just C#. + +Author: Kevin Gosse + +NuGet: +*https://www.nuget.org/packages/Silhouette/* + + +You can find more details at https://github.com/kevingosse/Silhouette + +Source: https://github.com/kevingosse/Silhouette + +::: + +### Author +:::note +Kevin Gosse +![Alt text](https://github.com/kevingosse.png) +::: + +### Original Readme +:::note + +Silhouette - A library to build .NET profilers in .NET +======================= + +# Quick start + +Create a new C# NativeAOT project. Reference the Silhouette nuget package and add a class inheriting from `Silhouette.CorProfilerCallback11Base` (you can use a different version of `CorProfilerCallbackBase` depending on the version of .NET you're targeting). Override the `Initialize` method. It will be called with the highest version number of `ICorProfilerInfo` supported by the target runtime. + +```csharp + +using Silhouette; + +[Profiler("0A96F866-D763-4099-8E4E-ED1801BE9FBC")] // Use your own profiler GUID here +internal partial class CorProfilerCallback : CorProfilerCallback11Base +{ + protected override HResult Initialize(int iCorProfilerInfoVersion) + { + if (iCorProfilerInfoVersion < 11) + { + return HResult.E_FAIL; + } + + var result = ICorProfilerInfo11.SetEventMask(COR_PRF_MONITOR.COR_PRF_ENABLE_STACK_SNAPSHOT | COR_PRF_MONITOR.COR_PRF_MONITOR_THREADS); + + return result; + } +} +``` + +The `Profiler` attribute triggers a source-generator that emits the proper `DllGetClassObject` function and validates that the user is using the matching guid for the profiler. Alternatively, you can manually implement a `DllGetClassObject` method that will be called by the .NET runtime when initializing the profiler. Use the built-in `ClassFactory` implementation and give it an instance of your `CorProfiler` class. + +```csharp +using Silhouette; +using System.Runtime.InteropServices; + +internal class DllMain +{ + // This code is automatically generated when using the `[Profiler]` attribute on `CorProfilerCallback` + [UnmanagedCallersOnly(EntryPoint = "DllGetClassObject")] + public static unsafe HResult DllGetClassObject(Guid* rclsid, Guid* riid, nint* ppv) + { + // Use your own profiler GUID here + if (*rclsid != new Guid("0A96F866-D763-4099-8E4E-ED1801BE9FBC")) + { + return HResult.CORPROF_E_PROFILER_CANCEL_ACTIVATION; + } + + *ppv = ClassFactory.For(new CorProfilerBase()); + + return HResult.S_OK; + } +} +``` + +`CorProfilerXxBase` offers base virtual methods for all `ICorProfilerCallback` methods, so override the ones you're interested in: + +```csharp + protected override HResult ThreadCreated(ThreadId threadId) + { + Console.WriteLine($"Thread created: {threadId.Value}"); + return HResult.S_OK; + } +``` + +Use the `ICorProfilerInfoXx` fields to access the `ICorProfilerInfo` APIs: + +```csharp + private unsafe string ResolveMethodName(nint ip) + { + try + { + var functionId = ICorProfilerInfo11.GetFunctionFromIP(ip).ThrowIfFailed(); + var functionInfo = ICorProfilerInfo2.GetFunctionInfo(functionId).ThrowIfFailed(); + using var metaDataImport = ICorProfilerInfo2.GetModuleMetaDataImport(functionInfo.ModuleId, CorOpenFlags.ofRead).ThrowIfFailed().Wrap(); + var methodProperties = metaDataImport.Value.GetMethodProps(new MdMethodDef(functionInfo.Token)).ThrowIfFailed(); + var typeDefProps = metaDataImport.Value.GetTypeDefProps(methodProperties.Class).ThrowIfFailed(); + + return $"{typeDefProps.TypeName}.{methodProperties.Name}"; + } + catch (Win32Exception) + { + return ""; + } + } +``` + +Most methods return an instance of `HResult`. You can deconstruct it into a `(HResult error, T result)` and manually check the error code. You can also use the `ThrowIfFailed()` method that will return only the result and throw a `Win32Exception` if the error code is not `S_OK`. + + +::: + +### About +:::note + +Profiling .net applications + + +Measuring performance improvements + + +::: + +## How to use + +### Example (source csproj, source files) + + + + + +This is the CSharp Project that references **Silhouette** +```xml showLineNumbers {13} + + + + Exe + net10.0 + enable + enable + true + true + + + + + + + + true + $(BaseIntermediateOutputPath)\GX + + + + +``` + + + + + + This is the use of **Silhouette** in *Program.cs* + +```csharp showLineNumbers +// See https://andrewlock.net/creating-a-dotnet-profiler-using-csharp-with-silhouette/ +Console.WriteLine("Please read https://andrewlock.net/creating-a-dotnet-profiler-using-csharp-with-silhouette/"); + +``` + + + + +### Generated Files + +Those are taken from $(BaseIntermediateOutputPath)\GX + + + + +```csharp showLineNumbers +namespace Silhouette._Generated +{ + using System; + using System.Runtime.InteropServices; + + file static class DllMain + { + [UnmanagedCallersOnly(EntryPoint = "DllGetClassObject")] + public static unsafe HResult DllGetClassObject(Guid* rclsid, Guid* riid, nint* ppv) + { + if (*rclsid != new Guid("8ad62131-bf21-47c1-a4d4-3aef5d7c75c6")) + { + return HResult.CORPROF_E_PROFILER_CANCEL_ACTIVATION; + } + + *ppv = ClassFactory.For(new global::ProfilerDemo.MyProfiler()); + return HResult.S_OK; + } + } +} +``` + + + + +## Useful + +### Download Example (.NET C#) + +:::tip + +[Download Example project Silhouette ](/sources/Silhouette.zip) + +::: + + +### Share Silhouette + + + +https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette + + + diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/index.md b/v2/rscg_examples_site/docs/RSCG-Examples/index.md index f2cbe063e..03e15a613 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/index.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/index.md @@ -1,7 +1,7 @@ --- sidebar_position: 30 -title: 248 RSCG list by category -description: 248 RSCG list by category +title: 249 RSCG list by category +description: 249 RSCG list by category slug: /rscg-examples --- @@ -1315,6 +1315,18 @@ import DocCardList from '@theme/DocCardList'; +## Profiler +
+ + Expand Profiler =>examples:1 + + + +[Silhouette](/docs/Silhouette) + +
+ + ## RX
@@ -1980,6 +1992,8 @@ flowchart LR; PrimitiveObsession--> Monify((Monify)) + Profiler--> Silhouette((Silhouette)) + RX--> RxSourceGenerator((RxSourceGenerator)) Serializer--> System.Text.Json((System.Text.Json)) diff --git a/v2/rscg_examples_site/docs/about.md b/v2/rscg_examples_site/docs/about.md index d726a9f9f..c55dec34d 100644 --- a/v2/rscg_examples_site/docs/about.md +++ b/v2/rscg_examples_site/docs/about.md @@ -6,7 +6,7 @@ title: About ## Content You will find here code examples -of 248 Roslyn Source Code Generator (RSCG) +of 249 Roslyn Source Code Generator (RSCG) that can be useful for you. That means, you will write more elegant and concise code - even if the generators code is not always nice to look. ## Are those examples ready for production? diff --git a/v2/rscg_examples_site/docs/indexRSCG.md b/v2/rscg_examples_site/docs/indexRSCG.md index cef5064aa..444493781 100644 --- a/v2/rscg_examples_site/docs/indexRSCG.md +++ b/v2/rscg_examples_site/docs/indexRSCG.md @@ -7,9 +7,9 @@ slug: /List-of-RSCG import useBaseUrl from '@docusaurus/useBaseUrl'; -## 248 RSCG with examples in descending chronological order +## 249 RSCG with examples in descending chronological order -This is the list of 248 ( 16 from Microsoft) RSCG with examples +This is the list of 249 ( 16 from Microsoft) RSCG with examples [See by category](/docs/rscg-examples) [See as json](/exports/RSCG.json) [See as Excel](/exports/RSCG.xlsx) @@ -20,6 +20,7 @@ This is the list of 248 ( 16 from Microsoft) RSCG with examples | No | Name | Date | Category | | --------- | ----- | ---- | -------- | +|249| [Silhouette by Kevin Gosse ](/docs/Silhouette)|2025-12-16 => 16 December 2025 | [Profiler](/docs/Categories/Profiler) | |248| [docopt.net by Atif Aziz ](/docs/docopt.net)|2025-12-15 => 15 December 2025 | [CommandLine](/docs/Categories/CommandLine) | |247| [BlazorOcticons by Evgeniy K. ](/docs/BlazorOcticons)|2025-12-14 => 14 December 2025 | [Blazor](/docs/Categories/Blazor) | |246| [Imposter by Bitchiko Tchelidze ](/docs/Imposter)|2025-12-13 => 13 December 2025 | [Tests](/docs/Categories/Tests) | @@ -115,7 +116,7 @@ This is the list of 248 ( 16 from Microsoft) RSCG with examples |156| [RSCG_NameGenerator by Ignat Andrei ](/docs/RSCG_NameGenerator)|2024-08-25 => 25 August 2024 | [EnhancementProject](/docs/Categories/EnhancementProject) | |155| [Coplt.Dropping by 2A5F ](/docs/Coplt.Dropping)|2024-08-13 => 13 August 2024 | [Disposer](/docs/Categories/Disposer) | |154| [Fluentify by Paul Martins ](/docs/Fluentify)|2024-08-02 => 02 August 2024 | [Builder](/docs/Categories/Builder) | -|153| [RSCG_ExportDiagram by AndreiIgnat ](/docs/RSCG_ExportDiagram)|2024-08-01 => 01 August 2024 | [EnhancementProject](/docs/Categories/EnhancementProject) | +|153| [RSCG_ExportDiagram by Ignat Andrei ](/docs/RSCG_ExportDiagram)|2024-08-01 => 01 August 2024 | [EnhancementProject](/docs/Categories/EnhancementProject) | |152| [ServiceScan.SourceGenerator by Oleksandr Liakhevych ](/docs/ServiceScan.SourceGenerator)|2024-07-22 => 22 July 2024 | [DependencyInjection](/docs/Categories/DependencyInjection) | |151| [ThisAssembly.Strings by Daniel Cazzulino ](/docs/ThisAssembly.Strings)|2024-07-21 => 21 July 2024 | [FilesToCode](/docs/Categories/FilesToCode) | |150| [ThisAssembly.Metadata by Daniel Cazzulino ](/docs/ThisAssembly.Metadata)|2024-07-20 => 20 July 2024 | [EnhancementProject](/docs/Categories/EnhancementProject) | diff --git a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js index 66d934d0c..b5871f230 100644 --- a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js +++ b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js @@ -4,7 +4,7 @@ import styles from './styles.module.css'; const FeatureList = [ { -title: '248 Examples (16 from MSFT)', +title: '249 Examples (16 from MSFT)', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> diff --git a/v2/rscg_examples_site/static/exports/RSCG.json b/v2/rscg_examples_site/static/exports/RSCG.json index 2dd135043..ceed9e04e 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -1985,6 +1985,14 @@ "Source": "https://github.com/docopt/docopt.net", "Category": "CommandLine", "AddedOn": "2025-12-15T00:00:00" + }, + { + "Name": "Silhouette", + "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/Silhouette", + "NuGet": "https://www.nuget.org/packages/Silhouette/", + "Source": "https://github.com/kevingosse/Silhouette", + "Category": "Profiler", + "AddedOn": "2025-12-16T00:00:00" } ] } \ No newline at end of file diff --git a/v2/rscg_examples_site/static/exports/RSCG.xlsx b/v2/rscg_examples_site/static/exports/RSCG.xlsx index db1cc9f21..f95779c33 100644 Binary files a/v2/rscg_examples_site/static/exports/RSCG.xlsx and b/v2/rscg_examples_site/static/exports/RSCG.xlsx differ diff --git a/v2/rscg_examples_site/static/sources/Silhouette.zip b/v2/rscg_examples_site/static/sources/Silhouette.zip new file mode 100644 index 000000000..9203b9add Binary files /dev/null and b/v2/rscg_examples_site/static/sources/Silhouette.zip differ