RSCG_WhatIAmDoing_Common 8.2024.10405.851

dotnet add package RSCG_WhatIAmDoing_Common --version 8.2024.10405.851
NuGet\Install-Package RSCG_WhatIAmDoing_Common -Version 8.2024.10405.851
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RSCG_WhatIAmDoing_Common" Version="8.2024.10405.851" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RSCG_WhatIAmDoing_Common --version 8.2024.10405.851
#r "nuget: RSCG_WhatIAmDoing_Common, 8.2024.10405.851"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RSCG_WhatIAmDoing_Common as a Cake Addin
#addin nuget:?package=RSCG_WhatIAmDoing_Common&version=8.2024.10405.851

// Install RSCG_WhatIAmDoing_Common as a Cake Tool
#tool nuget:?package=RSCG_WhatIAmDoing_Common&version=8.2024.10405.851

RSCG_WhatIAmDoing

Instrument C# software on CI to find what the software is doing.

Introduction

Decide what you want to monitor ... and then monitor it.

Example

Packages

Add the following into the csproj you want to be monitores

	<ItemGroup>
	  
	  <PackageReference Include="RSCG_WhatIAmDoing" Version="8.2024.10405.851" />
	  <PackageReference Include="RSCG_WhatIAmDoing_Common" Version="8.2024.10405.851" />
    </ItemGroup>

<PropertyGroup>

	<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
	<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath>
	<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);RSCG_InterceptorTemplate</InterceptorsPreviewNamespaces>
</PropertyGroup>

Code

Intercept static methods

Assume that you want to monitor all calls to System.Console

//[ExposeClass(typeof(Encoding), nameof(Encoding.EncodingName))]
//[InterceptStatic("System.IO.File.*ts")]
//[InterceptStatic("System.IO.File.*")]
[InterceptStatic("System.Console.*")] // regex
//[InterceptStatic("WIAD_DemoConsole.Fib.*")]
internal class InterceptorMethodStatic : InterceptorMethodStaticBase, IInterceptorMethodStatic
{
    
}

Intercept instance methods

Assume that you want to monitor all calls to any method of any instance of Person

//[InterceptInstanceClass(typeof(Person),"ame")]
//[InterceptInstanceClass(typeof(Person), "parat")]
//[InterceptInstanceClass(typeof(Person), "ncodi")]
[InterceptInstanceClass(typeof(Person), ".*")] //regex
public class InterceptorMethodInstanceClass: InterceptorMethodInstanceClassBase, IInterceptorMethodInstanceClass
{
    
    public InterceptorMethodInstanceClass()
    {
        
    }

}

See the results

var data= CachingData.Methods().ToArray();

foreach (var item in data)
{
    WriteLine($"Method {item.typeAndMethodData.MethodName} from class {item.typeAndMethodData.TypeOfClass} Time: {item.StartedAtDate} state {item.State} ");
    WriteLine($"  =>Arguments: {item.ArgumentsAsString()}");
    if ((item.State & AccumulatedStateMethod.HasResult) == AccumulatedStateMethod.HasResult)
    {
        WriteLine($"  =>Result: {item.Result}");
    }

}

More details

If you want to implement YOUR interception , implement the following interfaces

IInterceptorMethodInstanceClass

IInterceptorMethodStatic

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.2024.10405.851 100 4/5/2024
8.2024.10404.2057 85 4/4/2024
8.2024.10402.2257 86 4/2/2024
8.2024.10402.810 82 4/2/2024
8.2024.10401.810 85 4/1/2024
8.2024.10321.810 79 3/31/2024
8.2024.10316.2235 101 3/16/2024
8.2024.10316.2035 92 3/16/2024
8.2024.10201.735 102 2/1/2024
8.2024.10131.11824 79 1/31/2024