locked
Blazor sometime stop rendering child components RRS feed

  • Question

  • User-1619000197 posted

    I am rendering a child component in another component like this <InboxList></InboxList>

    now this is working at first then it stop rendering and when i inspect elements it is used like a html tag (it is printed like <InboxList></InboxList>)

    then after restarting again and again and after adding some other component with same name it start working and now it's not working again

    Note : i am using dotnet watch run so i don't need to restart and compile manually again and again, and i guess this error occur when i set a breakpoint in InboxList component and (as dotnet watch run ) won't hit breakpoints so i start the project from Visual Studio 2019 that's when it stop rendering

    even on making changes inside InboxList  is not starting watch (compile) again

    Tuesday, September 22, 2020 7:04 AM

Answers

  • User-1619000197 posted

    it is because i put these lines in my csproj file to enable dotnet watch run

    <ItemGroup>
        <Watch Include="**\*.razor" />
    </ItemGroup>

    these line are causing problem as i create new components these lines were automatically added in my csproj file

    <ItemGroup>
        <Content Remove="Pages\PatientDetail.razor" />
        <Content Remove="Pages\PatientDetailWorking.razor" />
        <Content Remove="Pages\Test.razor" />
      </ItemGroup>
      
      <ItemGroup>
        <Watch Remove="Pages\PatientDetail.razor" />
        <Watch Remove="Pages\PatientDetailWorking.razor" />
        <Watch Remove="Pages\Test.razor" />
      </ItemGroup>
      
      <ItemGroup>
        <None Include="Pages\PatientDetail.razor" />
        <None Include="Pages\MeasurmentList.razor" />
        <None Include="Pages\OutstandingTask.razor" />
        <None Include="Pages\PatientDetailWorking.razor" />
        <None Include="Pages\ProblemList.razor" />
        <None Include="Pages\Prompts.razor" />
        <None Include="Pages\Recalls.razor" />
        <None Include="Pages\Test.razor" />
      </ItemGroup>

    as soon as i comment these line and the first piece of code that i use to enable dotnet watch run everything start working

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 25, 2020 4:13 AM