I’ve run into an issue several times recently while working in Blazor where I’ll innocently try and run the application after some minor changes, only to be hit by a wall of errors seemingly out of nowhere:
ExamplePage.razor.cs(7, 29): [CS0115] 'ExamplePage.OnInitializedAsync()': no suitable method found to override
ExamplePage.razor.cs(12, 29): [CS0115] 'ExamplePage.OnAfterRenderAsync(bool)': no suitable method found to override
ExamplePage.razor.cs(17, 29): [CS0115] 'ExamplePage.OnParametersSetAsync()': no suitable method found to override
ExamplePage.razor.cs(22, 26): [CS0115] 'ExamplePage.SetParametersAsync(ParameterView)': no suitable method found to override
All of a sudden every single Razor component lifecycle function throughout the application is exploding and I’m left wondering how I managed to break things so spectacularly.
My approach to fixing this historically was:
Take a look at my local changes in Git
Try to tweak things to get it working again
Roll back everything and re-implement the change
It was frustrating and had wasted enough of my time over the past few months that I decided that I was going to figure it out once and for all, by gum.
For Valentine’s Day this year, I wanted to go a bit fancier than my usual shop-bought present, deciding instead that I would handmake a cushion and embroider our names on the front. My grandma taught me to sew many years ago and even though I’d not really used those skills much in the intervening time, I figured that it shouldn’t be too difficult.
Oh how naive of me.
If I’m going to be honest, my original plans were probably about as detailed as:
Embroider names on the front
As you might imagine, this wasn’t really sufficient planning on my part. By the time I was finished, my original plans had ballooned out to a frankly ridiculous number of individual points that I hadn’t even realised would be relevant at the start. As well as that, I began a couple of weeks before Valentine’s Day, worked on it whenever I had any spare time and still only finished it late in the evening the day before. In all, it probably took me about 15-20 hours of work to go from an initial idea to a finished project (what can I say, I’m apparently incredibly slow at sewing).