source generator razor components
i'm trying to source generate razor component
did a following thing ( see image ), but component is not rendering, but if i do
new foobar.SampleSourceGeneratedComponent()
in any c# file it works - no compilation or runtime errors, what am i doing wrong?
2 Replies
but if i copy the same code to other .cs file it working

You can't source generate razor components
Razor uses a source generator itself, and generators cannot see each other's output
How are you planning to decide what to generate? You'll probably be better off just writing a pre-build msbuild task