我在运行 Blazor 网站时遇到表单布局错误

gpj*_*pjs 0 c# error-handling circuit asp.net-core blazor

我更新了 Visual Studio 19,在此之前我的网站完全按照我的预期运行。现在,当我加载主页时出现错误,但在完成加载之前就中断了。我在下面提供了错误代码。我还想告诉您,我已经看过这篇文章(How to open 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.
Run Code Online (Sandbox Code Playgroud)

实施汉克斯解决方案后出现新错误

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)
Run Code Online (Sandbox Code Playgroud)

这是 CreateWebHostBuilder 方法

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
     WebHost.CreateDefaultBuilder(args)
     .UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
     .CaptureStartupErrors(true)
     .UseStartup<Startup>();
Run Code Online (Sandbox Code Playgroud)

Hen*_*man 5

首先从字面上接受建议。

在 Startup.ConfigureServices 中:

services
  .AddServerSideBlazor()
  .AddCircuitOptions(options => { options.DetailedErrors = true; });
Run Code Online (Sandbox Code Playgroud)

然后将结果发布在这里。