页: 1 NET MAUI Blazor Application, that share the UI with a traditional Blazor application, as can see in the Blazor Weather example found at https://github.com/danroth27/BlazorWeather。
我对这一公式的歪曲是,我希望能够在我的申请中使用认证,并分享尽可能多的法典。 理想的情况是,我想把所有重复逻辑放在共同的“倡议”中(以及当然还有网上和MAUI的版本)。
I ve tried to create a very basic sample Solution so you could see what my issue is. The public repository should be accessible at https://github.com/Dukenware/OneToRuleThemAll
下面的步骤:
- I ve started by creating a Blazor Server with default authentication of type "Individual Accounts".
- Tested that the application runs as expected.
- Created a Razor Class Library project that I ve added to the solution.
- Moved all logic from BlazorServer to the RazorClassLibrary project.
- Fixed HTML styling and so on so the application runs as before.
- Added MAUI Blazor project.
- Tested that the MAUI application runs as expected.
- Referenced the RazorClassLibraryProject.
- Tried displaying the UI from RazorClassLibrary by running the RazorClassLibrary.App from MauiBlazor s Main.razor.
- Getting the authentication exception:
GetAuthenticationStateAsync was called before SetAuthenticationState.
at Microsoft.AspNetCore.Components.Server.ServerAuthenticationStateProvider.GetAuthenticationStateAsync()
at Microsoft.AspNetCore.Components.Authorization.CascadingAuthenticationState.OnInitialized()
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
如果有人能向我指出我可以用来在我申请的基础上建造工作的寺庙,我真心 app。 任何反馈都受到热烈欢迎。