Blazor Error list stays empty

Ingmar Crone 51 Reputation points
2022-09-10T06:00:15.757+00:00

Hi there,

The Error list stays empty while using blazor.
The errors existing in Blazor components cause build errors but the errors aren't shown in the error list.

With kind regards

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,389 questions
0 comments No comments
{count} vote

5 answers

Sort by: Most helpful
  1. Ingmar Crone 51 Reputation points
    2022-09-10T06:40:51.247+00:00

    Okay, just so you guys understand what's going on.

    ------SomeBlazorComponent.razor------
    <p>@DeezNutz </p>

    @Aidan Wick {
    private string Name {get;set;} = SomeNamespacePart1.SomeNamespacePart2.SomeStaticClass.Name;
    }
    ------end SomeBlazorComponent.razor------

    ------SomeStaticClass.cs------
    namespace SomeNamespacePart1.SomeNamespacePart2
    {
    public static class SomeStaticClass(){
    public static string Name {get;} = "SomeSpecificName";
    }
    }
    ------end SomeStaticClass.cs------

    If you now are in the SomeStaticClass file and change the namespace (by hand do make sure it goes wrong),
    from "SomeNamespacePart1.SomeNamespacePart2" to "SomeNamespacePart1" for example.
    Then you rebuild the solution. It will give compile errors but don't show them in "Error List" (Ctrl+\,E).
    Only if you then go to the SomeBlazorComponent.razor file. It then shows the errors in the Error List.

    This means that if you are not in your blazor component at the moment (which you aren't because you're in another file)
    You don't know where the error is (and if you have really bad luck, you need to open ALL the blazor components one by one to see if the error is there.)

    I really hope this message makes it to someone from the blazor development team or the Visual Studio development team.

    With kind regards

    1 person found this answer helpful.

  2. Ingmar Crone 51 Reputation points
    2022-09-17T07:03:13.477+00:00

    242174-afbeelding.png

    242163-afbeelding.png


  3. Ingmar Crone 51 Reputation points
    2022-09-20T17:29:34.61+00:00

    @Zhi Lv - MSFT thanks for trying, the next time I have the issue I will use your link to report it.

    0 comments No comments

  4. Aeroverra 1 Reputation point
    2022-12-04T04:18:25.57+00:00

    Can confirm I have had this issue on and off for over 1.5 years on both stable and preview versions.

    0 comments No comments

  5. Eric Bos 0 Reputation points
    2023-01-27T09:10:21.6466667+00:00

    The errors are also ignored when it's built on the buildserver and you only find out when the page crashes the first time it's opened.

    0 comments No comments