This is based on the work from @fmrico in this branch.
The subfolder tf2_dotnet was extracted into this repository to make it separate from ros2/geometry2.
This works against the version of ros2_dotnet from this PR.
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 Foxy.