dotnet / dotnet/roslyn

In Visual Studio/blazor pressing F12 on other .razor component's class/subclass/method does not work

Open
#85,563 0 comments 0 reactions 0 assignees View on GitHub
Area-Razor
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

In VS Community 2022, server-side Blazor project pressing F12 on another .razor component's class/subclass or method does not take me to definition of that type. Instead I get message "Cannot navigate to symbol under carret".

Example:
Say I have a razor component called MsgBox.razor which has a method called Show().
When using this component in another component I cannot go to the definition of Show by pressing F12.

Microsoft Visual Studio Community 2022
Version 17.11.1
VisualStudio.17.Release/17.11.1+35219.272
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

ASP.NET and Web Tools 17.11.230.51983
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.11.230.51983
Azure App Service Tools v3.0.0

Bundler & Minifier 2.9.11
Adds support for bundling and minifying JavaScript, CSS and HTML files in any project.

C# Tools 4.11.0-3.24376.4+5e3a11e2e7f952da93f9d35bd63a2fa181c0608b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub Copilot 0.2.1634.3922
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.11.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core) 17.11.3.2436904+f07c7bb8e623ebcc1e1028cf11d101f866c77a79
Provides languages services for ASP.NET Core Razor.

Redgate SQL Prompt 1.0.0.0
Write, format, and refactor SQL effortlessly

SQL Server Data Tools 17.11.38.0
Microsoft SQL Server Data Tools

Text Macros for Visual Studio 2012-2022 1.18
Brings back text-editing macro support in Visual Studio 2012-2022

TypeScript Tools 17.0.30715.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.11.0-3.24376.4+5e3a11e2e7f952da93f9d35bd63a2fa181c0608b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.11.0-beta.24317.3+c07c8ebad62f6629b36349381991a299598a8d74
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

Web Compiler 1.14.11
Compiler for LESS, Sass and CoffeeScript files

### Expected Behavior

_No response_

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.