Based on https://github.com/schiller-de/tf2_dotnet, ported to work with the ros2cs framework https://github.com/BlackAndGoldAutonomousRacing/ros2cs based off of https://github.com/RobotecAI/ros2cs
The package tf2_msgs
must be built with ros2_dotnet
support, so include the geometry2 repository (with the right branch for your ROS distribution) in your workspace.
This was tested with ROS2 Humble.