c# – Task List displaying TODO comments as belonging to auto-generated files


I’m working with Visual Studio 2022 v17.14.23 on my very first Blazor project.

I ran into an unexpected behaviour when leaving a TODO comment in a .razor file: as long as said file is open in my IDE, the double click to redirect (from the Task List window to the comment) works as intended; however, upon closing the file, the Task List window displays the comment as belonging to the auto-generated version of that file instead of the original one.

E.G. : this is a snippet from CompanyAbout.razor:

@code {
    // TODO Comment
    [Parameter]
    public CompanyDto Company { get; set; }

    [Parameter]
    public Guid CompanyId { get; set; }
}

As soon as I close the file in the IDE, the Task List displays it as belonging to

[projectPath]\Components\Pages\CompanyAbout.razor.nPbiWifgIamTZKiY.ide.g.cs

where I would expect

[projectPath]\Components\Pages\CompanyAbout.razor

Is this supposed to happen?

Leave a Reply

Your email address will not be published. Required fields are marked *