Last post Nov 16, 2020 02:56 AM by Keep it Simple
Nov 16, 2020 01:28 AM|Keep it Simple|LINK
I created a new hosted Blazor WebAssembly solution which created 3 projects (targeting .NET 5 core)
I created a new C# Class file in Blazor.Shared project but it is not visible i.e. it is not recognized in the Blazor.Client project (Pages/Index.razor file)
I thought Classes were automatically shared and visible between Shared, Client and Server.
What do I have to do for the client project to gain scope of the class? Or have I done something wrong
The C# class is in Blazor.Shared namespace whilst the razor file is in Blazor.Client namespace. I am guessing this may have something to do with it.
Nov 16, 2020 02:56 AM|Keep it Simple|LINK
For anyone else, in the razor page I needed to add
and I forgot to make the C# class public