You can use startup hooks to inject code into any .net application
See https://bartwullems.blogspot.com/2022/03/impress-your-colleagues-with-your.html
- The
CodeConsultantsWelcomeStartupHook
project creates a simple startup hook that adds a copyright console message. - The
InvertedConsole
project creates a wrapper to invert console output.
In general these hooks are used via the DOTNET_STARTUP_HOOKS
environment variable e.g.
SET DOTNET_STARTUP_HOOKS=c:\....\Hook1.dll;c:\....\Hook2.dll"
Assuming use of saving repo to c:\Development\StartupHooks\
then the helper scripts are available
(otherwise copy/tweak to suite your environment).
- Using
CodeConsultantsWelcomeStartupHook
:- Use
set-debug-hook.bat
to assign the CodeConsultantsWelcomeStartupHook Debug dll - Use
set-release-hook.bat
to assign the CodeConsultantsWelcomeStartupHook Release dll
- Use
- Using
InvertedConsole
:- Use
inverted-debug.bat
to assign the InvertedConsole Debug dll - Use
inverted-release.bat
to assign the InvertedConsole Release dll
- Use
- Using
TrackStartStop
:- Use
startstop-debug.bat
to assign the TrackStartStop Debug dll - Use
startop-release.bat
to assign the TrackStartStop Release dll
- Use
- Use
clear-hooks.bat
to clear the hook assignment - Use
run.bat
to execute theConsoleApp
project