I will research about Blazor Component after this video. It has been 3 years since my first heard of it. I hope Blazor could be useful in any kind of project size.
I am very new to asp.net. I just met a issue that one I run the IIS Express button, the page render out with correct layout that all images have their own new button, but soon it is flashed out and just left one pic without a button on the page, it looks like some data rendering failed at the end. who meets this else and how to fix this? thanks
for some reason in my "Blazor" page, 'code' does not exist in the current context so nothing below @code can fix that. Is it a bug or did I miss something? same thing happens if I copy paste the code from the github, my VS version is the latest at the moment '16.3.1'. same thing happens if I create a new Razor Components item, @code will immediately not exist. edit: what the hell, it just fixed itself after I deleted the newly created Razor Components item. This is most likely a "caching" bug.
Was it a compile error or just an intellisense error? Intellisense operates by compiling behind the scenes, and on my machine compilation of a razar page takes a little bit, so it takes some time for intellisense to catch up.
Given the lack of replies to any of the comments and issues I see below I am not sure if it is worth asking but here goes... Despite @using .Components even being generated and placed correctly by resharper when resolving ProductList, I am getting a compiler error saying that the namespace does not exist. Also, the _framework/blazer.server.js seems to also be unresolved. Is there a package I am meant to install ? using .Net 5.0 so not sure if these issues are related to the version I am using but would have assumed compatible... Also - I find this stuff difficult to learn because it is difficult to know what to actually do. its almost like the people who developed this framework are the only people who know how it works and how to use it...hence the reason why I still have not created a website. It is I suppose meant to be easier but I dont think they have in any way made it intuitive - maybe a better introductory tutorial would be one introducing the architecture of these apps and how they work under the hood so it is clear as to what gets added, how it is added, why it is added, when etc.
It won't recognize my components folder under WebSite. I see Controllers, Models, Service and Pages. I even checked to make sure that Components was in the same scope as the others. Can someone please help me?
If you're still looking into this, the issue is that it doesn't get filed under WebSite automatically. If you just put in "@using Components;" it should find the namespace
In this this doesn't outright work, the solution is to copy and paste the original .json code over the one in the file. From last video, that "rate" command modifies something about the json that makes it unaccessible later.
In case you haven't fixed this yet, I added a comment on the previous video (9 of 13), explaining how the File.OpenWrite(...) command doesn't open the file for create, but instead just starts writing from the beginning, which could leave you with a bad json. I also tried to explain how to fix it.
Just like @John Cox said, the issue is File.OpenWrite(). I'll leave the function here. Goes under JsonFileProductsService in add ratings private void SerializeFile(IEnumerable products) { using FileStream outPutStream = File.Open(JsonFileName, FileMode.Create, FileAccess.Write); JsonSerializer.Serialize ( new Utf8JsonWriter(outPutStream, new JsonWriterOptions { SkipValidation = true, Indented = true }), products ); }
I am quite disappointed with this course from Microsoft. You are not giving any explanation for what you are doing and why you are doing it? How someone can do this on their own unless they understand it clearly.
I am seeing something similar, that I have a mix of .WebSite and .Website, with a case difference on the 'S'. I tried replacing all instances of .Website with the uppercase version .WebSite, but now it doesn't build. Error CS0234 The type or namespace name 'Components' does not exist in the namespace 'ContosoCrafts.WebSite' (are you missing an assembly reference?)