microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
220 stars 9 forks source link

[BUG] Constand "Write after end" errors in Developer Console. #1328

Open jtsom opened 1 month ago

jtsom commented 1 month ago

Describe the Issue

When selecting any Razor file in a .Net 8 Blazor app, there is an error reported in the console:

image

Steps To Reproduce

  1. In a .Net 8 Blazor application, click on any .razor file to show in the editing window.
  2. Look in the developer console.
  3. See the error above for every .razor file as they are clicked.

Expected Behavior

No Errors.

Environment Information

AbhitejJohn commented 1 month ago

Tagging @phil-allen-msft since this seems blocking.

ryzngard commented 3 weeks ago

This doesn't look related to razor at all, it's the C# Dev Kit extension reporting an error.

Are you seeing any impact on features from this? This doesn't appear for me locally but the current pre-release versions are higher than the ones used.

rjgotten commented 2 weeks ago

@ryzngard Are you seeing any impact on features from this?

See #1371 - where I'm also getting this. In addition to a lot of bogus errors regarding unkown types as reported in that issue, I'm also stuck having to filter out approx 500 non-existent errors from *.cshtml__virtual.cs files generated by Razor (i.e. plain old MVC Razor, not Blazor). So the two may in fact be connected.

jtsom commented 2 weeks ago

@ryzngard Are you seeing any impact on features from this?

See #1371 - where I'm also getting this. In addition to a lot of bogus errors regarding unkown types as reported in that issue, I'm also stuck having to filter out approx 500 non-existent errors from *.cshtml__virtual.cs files generated by Razor (i.e. plain old MVC Razor, not Blazor). So the two may in fact be connected.

Agreed. This issue with the non-existent errors I reported months ago and it was punted from the VSCode C# extension to the Razor group, and there's been nothing done. (As far as I could tell, the problem began when the C# extension was changed to being built with the .Net 9 preview SDK. Installing an older version of the C# extension (I forget which version, but may be back to 2.32.16?) cleared up the error. You can see, looking at the release notes, the first version built with .Net 9, is when it broke.

github-actions[bot] commented 2 weeks ago

@ryzngard, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.

ryzngard commented 2 weeks ago

The errors in this issue are if you open the developer console for vs code, not errors reported in the "Problems" output.

@rjgotten I didn't see cshtml mentioned in https://github.com/microsoft/vscode-dotnettools/issues/1371 . Are you seeing these problems only in MVC Razor?

@jtsom I'm assuming you're talking about https://github.com/dotnet/razor/issues/10505 ?

rjgotten commented 2 weeks ago

The errors in this issue are if you open the developer console for vs code, not errors reported in the "Problems" output.

@rjgotten I didn't see cshtml mentioned in #1371 . Are you seeing these problems only in MVC Razor?

@jtsom I'm assuming you're talking about dotnet/razor#10505 ?

I hadn't gotten round to filing the *.cshtml__virtual.cs specific errors. But those are only in the range of ~500 or so specific to classes being used in .cshtml razor files. Whereas the full number of 20K+ bogus errors wrt missing types largely comes from throughout the entire codebase mentioned in #1371 - i.e. also regular old C# 'library' projects.

dotnet/razor#10505 appears to also exactly be what I'm getting in #1371. I'm going to update that issue to make mention as well.