How to use Authorization namespace in a shared Razor Class Library Project?

邮差的信 提交于 2021-02-10 14:58:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!