gpt4 book ai didi

c# - 运行Blazor网站时出现版式错误

转载 作者:行者123 更新时间:2023-12-03 08:03:29 26 4
gpt4 key购买 nike

我更新了Visual Studio 19,在此之前,我的网站完全按照我的预期运行。现在,我在加载主页时遇到错误,但是在完成加载之前就中断了。我在下面提供了错误代码。我还会让您知道,我已经看过这篇文章(How to turn on CircuitOptions.DetailedErrors?)并尝试了所有内容,但没有用。

Information: Normalizing '_blazor' to 
'http://fakesite.com/_blazor'.

Error: There was an unhandled exception on the current circuit, so this
circuit will be terminated. For more details turn on detailed exceptions in
'CircuitOptions.DetailedErrors'

Information: Connection disconnected.

实现Hanks解决方案后出现新错误
Error: Microsoft.JSInterop.JSException: Could not find 'FormLayout' in 'window.DxBlazor'.
Error: Could not find 'FormLayout' in 'window.DxBlazor'.
at http://fakesite.com/_framework/blazor.server.js:8:27768
at Array.forEach (<anonymous>)
at d (http://fakesite.com/_framework/blazor.server.js:8:27729)
at http://fakesite.com/_framework/blazor.server.js:8:28342
at new Promise (<anonymous>)
at e.beginInvokeJSFromDotNet (http://fakesite.com/_framework/blazor.server.js:8:28316)
at http://fakesite.com/_framework/blazor.server.js:1:19148
at Array.forEach (<anonymous>)
at e.invokeClientMethod (http://fakesite.com/_framework/blazor.server.js:1:19119)
at e.processIncomingData (http://fakesite.com/_framework/blazor.server.js:1:17165)
at Microsoft.JSInterop.JSRuntimeBase.InvokeWithDefaultCancellation[T](String identifier, IEnumerable`1 args)
at Microsoft.AspNetCore.Components.Rendering.Renderer.GetErrorHandledTask(Task taskToHandle)

这是CreateWebHostBuilder方法
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
.CaptureStartupErrors(true)
.UseStartup<Startup>();

最佳答案

首先从字面上接受建议。

在Startup.ConfigureServices中:

services.AddServerSideBlazor().AddCircuitOptions(options => { options.DetailedErrors = true; });

然后在此处发布结果。

关于c# - 运行Blazor网站时出现版式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57593583/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com