Troubleshooting

  • 4 minutes to read

This topic describes common issues and steps you can follow to diagnose and resolve these issues. If the solutions listed here do not help, create a ticket in our Support Center.

Common Issues

An unhandled exception on the current circuit

The following error message about an exception on the current circuit can be shown:

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

To get more information about the error, add the following code to the ConfigureServices method declared in the Startup.cs file:

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

System.ArgumentNullException: Value cannot be null. (Parameter 'accessor')

This is a common Blazor exception that occurs if an EditForm's editor does not use two-way binding.

To fix the issue, do one of the following:

  • Specify the Expression property for the properties you use. For example, if you use the SelectedItem property and the SelectedItemChanged event separately, specify the SelectedItemExpression property also.
    <DxComboBox Data="@Strings"
        SelectedItem="@selectedItem" 
        SelectedItemChanged="@SelectedItemChanged"
        SelectedItemExpression="@(() => selectedItem )">
    </DxComboBox>
    
  • Implement the two-way binding in the EditForm.

Could not find 'X' in 'window.DxBlazor'.

In the previous versions of Blazor components, users had to add the client scripts. In the latest versions, we distribute the scripts via the NuGet Package in the _content/DevExpress.Blazor folder. If you reference an older version of our static files, you can face a similar issue:

Error: Microsoft.JSInterop.JSException: Could not find 'FormLayout' in 'window.DxBlazor'.
Error: Could not find 'FormLayout' in 'window.DxBlazor'.

We recommend that you use the latest versions of our components distributed via NuGet Packages.

InvalidOperationException

If you use Blazor WebAssemly DataGrid, you may see the following exception in a browser:

System.InvalidOperationException: No generic method 'Take' on type 'System.Linq.Queryable' is compatible with the supplied type arguments and arguments.

To resolve this issue, do one of the following:

  • Set the BlazorLinkOnBuild property to false in the project file to disable the link with an MSBuild property.
    <PropertyGroup>
    ...
      <BlazorLinkOnBuild>false</BlazorLinkOnBuild>
    </PropertyGroup>
    
  • Add the Linker.xml file and include the following code:
    <?xml version="1.0" encoding="UTF-8" ?>
    ...
    <linker>
      <assembly fullname="mscorlib">
      ...
        <type fullname="System.Threading.WasmRuntime" />
      </assembly>
      <assembly fullname="System.Core">
      ...
        <type fullname="System.Linq.Expressions*" />
        <type fullname="System.Linq.Queryable*" />
        <type fullname="System.Linq.Enumerable*" />
        <type fullname="System.Linq.EnumerableRewriter*" />
      </assembly>
      ...
      <assembly fullname="[PUT YOUR ASSEMBLY NAME HERE]" />
    </linker>
    
    Then specify this file as a MSBuild item in the project file.
    <ItemGroup>
      ...
      <BlazorLinkerDescriptor Include="Linker.xml" />
    </ItemGroup>
    

See Configure the Linker for ASP.NET Core Blazor for more information.

MissingMethodException

If you use Blazor WebAssemly Scheduler, the following exception can be shown in a browser:

System.MissingMethodException: Constructor on type 'System.ComponentModel.Int32Converter' not found.

To resolve this issue, do one of the following:

  • Set the BlazorLinkOnBuild property to false in the project file to disable the link with an MSBuild property.
    <PropertyGroup>
    ...
      <BlazorLinkOnBuild>false</BlazorLinkOnBuild>
    </PropertyGroup>
    
  • Add the Linker.xml file and include the following code:
    <?xml version="1.0" encoding="UTF-8" ?>
    ...
    <linker>
      ...
      <assembly fullname="System">
          <!-- Use this line to include the entire assembly. -->
          <type fullname="System.ComponentModel*" />
          <!-- Uncomment the following lines to include individual types. -->
          <!-- <type fullname="System.ComponentModel.Int32Converter*" />
          <type fullname="System.ComponentModel.BooleanConverter*" />
          <type fullname="System.ComponentModel.DateTimeConverter*" />
          <type fullname="System.ComponentModel.StringConverter*" /> -->
          ...
      </assembly>
    </linker>
    
    Then specify this file as a MSBuild item in the project file.
    <ItemGroup>
      ...
      <BlazorLinkerDescriptor Include="Linker.xml" />
    </ItemGroup>
    

See Configure the Linker for ASP.NET Core Blazor for more information.

Tabs are rendered incorrectly when the default Microsoft template is applied

If you create a new Blazor project based on the default Microsoft project template, the first tab of the DxTabs component can be rendered incorrectly.

See the following Microsoft issues that cause this behavior:

To resolve the issue, specify strict style rules in the site.css file to apply .navbar templates only.