'Blazor Webassembly Azure AD Authentication in .net 6.0 exception invalid Url
I upgrade my Client Project to .net 6.0, I got the property undefined error after deploying in IIS, I added the TrimmerRootAssembly to csproj
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.Authentication.WebAssembly.Msal" />
</ItemGroup>
as Suggestion in this Question Blazor WASM Net 6 Preview 4 Azure AD - There was an error trying to log you in: 'Cannot read property 'toLowerCase' of undefined' but then I got another error invalid Url
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Failed to construct 'URL': Invalid URL
TypeError: Failed to construct 'URL': Invalid URL
at new u (https://devdms/_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js:2:191011)
at Function.init (https://devdms/_content/Microsoft.Authentication.WebAssembly.Msal/AuthenticationService.js:2:196273)
at https://devdms/_framework/blazor.webassembly.js:1:3332
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://devdms/_framework/blazor.webassembly.js:1:3306)
at Object.Rt [as invokeJSFromDotNet] (https://devdms/_framework/blazor.webassembly.js:1:59738)
at _mono_wasm_invoke_js_blazor (https://devdms/_framework/dotnet.6.0.1.716ng6fo9h.js:1:194546)
at https://devdms/_framework/dotnet.wasm:wasm-function[219]:0x1a129
at https://devdms/_framework/dotnet.wasm:wasm-function[167]:0xcaf7
at https://devdms/_framework/dotnet.wasm:wasm-function[166]:0xba0a
Microsoft.JSInterop.JSException: Failed to construct 'URL': Invalid URL TypeError: Failed to construct 'URL': Invalid URL
any idea what the problem is? btw the project work locally without any problem
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
