Open pmarangoni opened 4 months ago
Just to add, this is a screenshot when trying to create a new customer. I enter values for each field, and after submitting the form (by clicking Create Customer), the page reloads with errors displayed under Customer Id and Company Name.
A little help please.
I have updated the online section with new instructions and made the same changes to the PracticalApps
solution code in the Northwind.WebApi
, Northwind.Blazor
, and Northwind.Blazor.Wasm
projects. This should fix the problems.
https://github.com/markjprice/cs12dotnet8/blob/main/docs/ch15-blazor-wasm.md
Switching to the WebAssembly component
I was getting weird errors in the browser's console trying to get this to work.
Failed to start platform. Reason: TypeError: Cannot read properties of undefined (reading 'AspNetCore')
I found that others had similar issues and followed their advice and got it to work. Basically, I closed Visual Studio, then deleted the folders underneath the Northwind.Blazor.Wasm project's obj and bin folders. Restarted Visual Studio and it worked fine.
This is where I found the advice: https://github.com/dotnet/aspnetcore/issues/50755
I don't really have a lot of confidence in Blazor as a platform yet. I feel like it's still going through some nasty growing pains.
I agree with you. To me, Blazor is still an "unstable" platform both in that it has more bugs than alternatives like MVC and that it is still evolving.
.NET 8 introduced huge changes in Blazor that meant the way I had designed my step-by-step instructions for the .NET 7 edition then broke with .NET 8 in ways that I discovered couldn't be easily fixed. When I first looked at the issues readers like you were having I tried to find some simpler fixes but ended up having to almost rewrite that whole section.
Blazor feels too much like the old Web Forms (.aspx
) which tried to hide too much and ended up building a massive mess on top of web development.
I'm sorry I wasn't able to provide a solution earlier. I appreciate how frustrating that must have been for you and others. Thank you for your patience.
p.s. I will add the information you found about the Failed to start platform.
issue to the page too.