VS2022, View Code (F7) on Razor Page doesn't work

VS2022, with both Mercury and Silver.

If I am looking at a Razor page (.cshtml), and I right click in the editor anywhere on the page, one of the context menu options is View Code.

image

Currently if I click on that menu or press F7 with Mercury or Silver, nothing happens.

With a regular, equivalent C# project (non-Elements), doing this would load the associated page model code (so for example, on the Index.cshtml file, it would load the Index.cshtml.cs file).

Obviously this isn’t a big deal, as I can still open the file another way. But this is a keyboard shortcut I use quite a bit, so it would be nice if this is something you are able to address.

Thanks,

–Avonelle

So to be clear this, should simply show the paired file not the generated one (something I have recently hooked up in Fire/Water)?

Logged as bugs://E25976.

Yes, it should show the paired file and not any generated one. I don’t think there are generated ones for ASP.NET Core Razor pages applications (at least I don’t see any in my projects), but certainly I do for Web Forms applications, and in cases where there was an Index.aspx, Index.aspx.designer.vb (generated), and Index.aspx.vb, I would expect “View Code” on the Index.aspx page to load/show the Index.aspx.vb file.

In the rare case where I need to look at the generated file, I would load it via double clicking on the file in the solution explorer.

–Avonelle

bugs://E25976 was closed as fixed.