-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Found markup element with unexpected name 'Customers'. If this is intended to be a component, add a @using directive for its namespace. #52
Comments
None of the steps on page 723 need to import the |
I did correctly name the Customers.razor file and it was created in the Pages folder, and I will have to concede that importing the Packt.Shared namespace was not necessary at that time. It still doesn't explain why the statements added in step 3, page 723, show up in the Visual Studio editor underlined with a green squiggle which lists the warning with the text supplied quoted in the heading to this issue I raised. I've now got as far as page 735 in the book and the warning squiggles still show on those lines added to the Index.razor file in step 3. So why the text "Customers in Germany/Customers Worldwide" didn't appear until after I'd made the adjustment is still unclear to me. I find that there are many things that I still do not understand, and have to take on trust. Templates on creating files can be sometimes contain significant differences from the code presented in the book without any covering explanation. And sometimes making a link between the result and a statement of code which brings about that result is not always obvious -- unless perhaps you are well versed in the underlying software which is hidden from view. |
Yes, I agree it's unclear to me as well as to why you got that warning message. It doesn't make sense to me. FYI, there is already an errata item for the issue on page 733 here: |
Chapter: 16
Page Number: 723
Section Title: Building components using Blazor Server/Defining and testing a simple Blazor Server component
Step Number: 3
Problem to fix: RZ10012 ...unexpected name 'Customers' ...
-- Results in "Customers in Germany" and "Customers Worldwide" not being displayed in step 5.
Suggested solution: Add usings statement to bottom of _Imports.razor in Shared folder as follows:
@using Packt.Shared @* Northwind entities *@
Other useful information e.g. OS, coding tools, and so on: Microsoft Visual Studio Community 2022 (64bit) Version 17.5.1, Microsoft .NET Framework version 4.8.04161 as at 29/03/2023.
The text was updated successfully, but these errors were encountered: