Blazor WASM Net 6 Preview 4 Azure AD - There was an error trying to log you in: #39;Cannot read property #39;toLowerCase#39; of undefined#39;(Blazor WASM Net 6 Preview 4 Azure AD-尝试让您登录时出错:#39;无法读取未定义#39;的属性#39;to LowerCase#39;)
问题描述
我有一个运行Net 6 Preview 4的简单Blazor WASM,我使用此指南进行了设置:
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory?view=aspnetcore-6.0
准确的代码与Net 5.0完美配合(使用相应的Net 5.0程序集)
但是,当我升级到Net 6时,收到以下身份验证错误:
There was an error trying to log you in: 'Cannot read property 'toLowerCase' of undefined'
我似乎也无法获得更多细节。此内容发布在Azure应用服务自含式发布上。
代码可以在以下位置找到: https://github.com/aherrick/BlazorWASM.Net6Prev4.AzureAD
推荐答案
此处讨论了此问题的解决方法: https://github.com/dotnet/aspnetcore/issues/33312。
简而言之,该问题是由装配修剪引起的。解决方法是通过在客户端项目文件中包含以下内容来从裁剪中排除Microsoft.Authentication.WebAssembly.Msal
:
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.Authentication.WebAssembly.Msal" />
</ItemGroup>
这篇关于Blazor WASM Net 6 Preview 4 Azure AD-尝试让您登录时出错:';无法读取未定义';的属性';to LowerCase';的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!