Skip to content
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

does not declare @inject ILogger<FileUpload1> #28452

Closed
jorgearana opened this issue Feb 19, 2023 · 2 comments
Closed

does not declare @inject ILogger<FileUpload1> #28452

jorgearana opened this issue Feb 19, 2023 · 2 comments
Assignees
Labels
Blazor doc-provided Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@jorgearana
Copy link

The examples in this page does not work because, VS does not recognize @Inject ILogger.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue labels Feb 19, 2023
@guardrex
Copy link
Collaborator

Hello @jorgearana ... It sounds like you didn't name the component FileUpload1.razor. The name "FileUpload1" is the classname of the component. Change that to whatever you named it. For example, it you named it MyFileUploader.razor, then make that line @inject ILogger<MyFileUploader> Logger.

This aspect of Blazor is covered at https://learn.microsoft.com/aspnet/core/blazor/components/#markup, and namespaces for components are covered at https://learn.microsoft.com/aspnet/core/blazor/components/#namespaces.

@guardrex
Copy link
Collaborator

guardrex commented Feb 19, 2023

... and FYI ...

When I pulled up those cross-links, I think a smidgen of work on the content layout is in order. I think the class name remarks perhaps should be rolled into the Namespace section remarks with a section heading name change to Class name and namespace. It feels a little out of place where I currently have it in the Markup section. I have a work item coming up to split some sections of out the Components overview topic because it's getting too long. I added a note on this to that work item, and I'll address it in the topic with those updates coming in about a month or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor doc-provided Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Archived in project
Development

No branches or pull requests

3 participants