问题
I can use the Microsoft.AspNetCore.Components.Authorization namespace in my Blazor Server Project. However, I can't get it to work in my Razor Class Library project.
I even added the same Nuget Libraries and mirrored the _Imports.razor
file, but the library project doesn't recognize this namespace. Is there some limitation or am I doing something wrong?
回答1:
The namespace name usually matches an Assembly and a Package. You can easily find out with the F12 key or consult the docs. The page you linked to identifies the assembly the class is in.
And it can indeed be included in some meta package. You wouldn't like the full list of packages that go into an Asp.Net Core app.
来源:https://stackoverflow.com/questions/62761351/how-to-use-authorization-namespace-in-a-shared-razor-class-library-project