VSTA C# macro interface casting?

Anyone know what I have setup incorrectly in the VSTA C# macro environment?
Any time I cast one interface to another interface it blows up.
I copied this simple code right out of the Knowledge base.
Any pointers to what settings I might need to change or what levels I might need to be on.
This example is in the cloud but I get the same issue onPrem at 2023x FD04.