0

I updated visual studio 19 and before that my site ran exactly how i intended it. Now i am getting an error when i load the home page but then breaks before it can finish loading it. I have provided the error code below. I also would let you know that i have seen this post ( How to turn on CircuitOptions.DetailedErrors? ) and tried it all but it hasn't worked.

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.

new error after implementing Hanks solution

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)

this is the CreateWebHostBuilder method

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
     WebHost.CreateDefaultBuilder(args)
     .UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
     .CaptureStartupErrors(true)
     .UseStartup<Startup>();
gpjs
  • 47
  • 1
  • 11
  • Can you post your `CreateWebHostBuilder` method code? – MindSwipe Aug 21 '19 at 14:12
  • Hey @MindSwipe , i have added the method to my post – gpjs Aug 21 '19 at 14:23
  • Are you using the latest version .NET Core 3.0 Preview 8? The latest Visual Studio 2019 update was afaik for the Preview 8. Could be a .NET Core versioning problem. – Pascal R. Aug 21 '19 at 14:52
  • Hey @PascalR. , i am using the latest version .NET Core 3.0 Preview 8. – gpjs Aug 21 '19 at 15:00
  • What you have posted is OK, but what about the hosting? Are WebSockets enabled? How do you deploy (Self-contained or not?) – H H Aug 21 '19 at 18:12
  • Ok, it now looks like a problem with hosting or publishing. Do you have (and use) an option like "Remove additional files at destination" ? – H H Aug 21 '19 at 18:53
  • @HenkHolterman No i do not have an option like that – gpjs Aug 21 '19 at 18:57
  • Well, inform us about how you deploy to what host. – H H Aug 21 '19 at 21:23
  • You seem to use DevExpress for Blazor. Have you updated the DevExpress NuGet package to the latest version preview 8? Are there four files in `wwwroot/lib/dx-blazor`? – Pascal R. Aug 22 '19 at 09:23
  • Hey @HenkHolterman i publish it to IIS on a local Microsoft sever – gpjs Aug 22 '19 at 13:19
  • Hey @PascalR. yes i am using DevExpress and i have the latest preview 8 v0.2.0. i also have all the necessary files as to what there github describes. – gpjs Aug 22 '19 at 13:23
  • Another user seems to have had the same problem in this stackoverflow question: https://stackoverflow.com/questions/57609202/error-after-updating-visual-studio-2019-preview He solved it by deleting his browser cache / cookies. Does that work for you? – Pascal R. Aug 22 '19 at 13:26
  • @PascalR. i do not believe his problem is the same as mine, but i tried it anyway and to no avail. – gpjs Aug 22 '19 at 14:02

3 Answers3

5

Start by taking the advice literally.

In Startup.ConfigureServices:

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

and then post the results here.

H H
  • 263,252
  • 30
  • 330
  • 514
1

After the update to visual studios there was updares to all my NuGet packages too. This included the DevExpress for Blazor NuGet package and with that update they changed the link to the dx-blazor.js and dx-blazor.css files that your supposed to put I your layout’s HEAD section.

From:

<link href="lib/dx-blazor.css" rel="stylesheet" />
<script src="lib/dx-blazor.js"></script>

To:

<link href="lib/dx-blazor/dx-blazor.css" rel="stylesheet" />
<script src="lib/dx-blazor/dx-blazor.js"></script>

Hope this maybe helps others in my situation or in a situation similar to mine.

tomRedox
  • 28,092
  • 24
  • 117
  • 154
gpjs
  • 47
  • 1
  • 11
1

It seems that this is issue is related to client scripts. If you see "window.DxBlazor" in the message, this means that you need to look for the cause in the client scripts. Please make sure that you have the latest up-to-date DevExpress scripts included in your project. See the 6th item of the How to create a new project paragraph.    

Paul
  • 110
  • 5