Maybe try this. Program.cs :
and in your page:
This script is from an RCL I published as a Nuget package.
Extra bonus: If you need to use pages from an RCL you will need to declare them to the router.
Routes.cs:
If this doesn't work, please share your code.