我已经开始使用托管模型学习Blazor Webassembly。
在本地,我可以使用visual studio代码创建并运行一个简单的Blazor web应用程序。
但是,当我发布(在本例中是www.myasp.net)时,任何页面上都会出现以下脚本错误:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer100未处理的异常呈现组件:意外的token <位置0的JSON中的SyntaxError:意外的token <位置0的JSON中的Microsoft.JSInterop.JSException:意外的token <位置0的JSON中的SyntaxError:意外的token <位置0处的JSON () <0x21ea748 + 0x0002c> in :0 at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync (Microsoft.JSInterop.IJSRuntime jsRuntime,System.String identifier,System.Object[] args) <0x2010058 + 0x000e4> in :0 at
谢谢
下面是完整的错误:
Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer100未处理的异常呈现组件:意外的token <在位置0的JSON中SyntaxError:意外的token <在位置0的JSON中Microsoft.JSInterop.JSException:意外的token <在位置0的JSON中SyntaxError:意外的token <在位置0的JSON中TAccount,TProviderOptions.EnsureAuthService () <0x20084c0 + 0x000ee> in :0 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3[TRemoteAuthenticationState,TAccount,TProviderOptions].GetAuthenticatedUser () <0x2007c20 + 0x000d2> in <filename unknown>:0 at System.Threading.Tasks.ValueTask1TResult.get_Result () <0x21ebf88 + 0x0002c> in :0 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3[TRemoteAuthenticationState,TAccount,TProviderOptions].GetUser (System.Boolean useCache) <0x1fcb190 + 0x00136> in <filename unknown>:0 at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationService3TRemoteAuthenticationState,TAccount,Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion () <0x1fc9ff0 + 0x000d0> in :0 at Microsoft.AspNetCore.Components.Authorization.AuthorizeViewCore.OnParametersSetAsync () <0x2135338 + 0x0012e> in :0 at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion (System.Threading.Tasks.Task任务) <0x2135d90 + 0x000ee> in :0 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync () <0x1f67eb0 + 0x0020c> in :0 at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle) <0x21391a0 + 0x000ca> in :0
发布于 2021-05-17 22:23:48
是,
中
"IdentityServer": {
"Clients": {
"xxxxxxxxx.Client": {
"Profile": "IdentityServerSPA"
}
},
"Key": {
"Type": "File",
"FilePath": "xxxxxxxxx.pfx",
"Password": "xxxxxxxxx"
}
}https://stackoverflow.com/questions/64503461
复制相似问题