Blazor Code-Behind: Why Is OnInitialized Not Finding Its Overridden Method?
You should remove the line
@inherits CreateForecast
I checked, adding @inherits does produce:
Error CS0115 'FetchData.BuildRenderTree(RenderTreeBuilder)': no suitable method found to override...
That was not obvious.
@inherits
was used in older versions of Blazor when the classes were not yet generated as partial
.
Now they are partial
and you are trying to inherit a class from itself.
Side note, in CreateForecast.Razor.cs you can shorten the defintion to
//public partial class CreateForecast : ComponentBase
partial class CreateForecast
this reduces clutter and the chance for errors.