Get class source code instead of metadata in Visual Studio

Sometimes, when I work on a project, I press the "go to definition" button (by default I consider F12) on a class or method or something else. Big! It works like a dream to expect when I have code that is built into the assembly. In these cases, the โ€œdefinitionโ€ is contained in the generated file โ€œ[from metadata]โ€. Of course, this makes sense, especially for third-party things, but what about cases where I know where the source code is? Is there a way that Visual Studio can put extra effort into code transition? Is there a macro or something out there that can be done? Am I doomed?

ps
I know that Resharper and similar tools can do this, but I donโ€™t have them, so let's just choose these types of answers.

+4
source share
1 answer

As a result, you cannot view the source code using the "Go to Definition" for classes that are included in your project through file links (usually third-party assemblies). For classes that are included through project links, you can view the code this way. All "Go to definition" is an attempt to find a code file for the type of your project or the project to which reference is made. If you do not have an available code file (which would be for third-party assemblies), it will not be able to show it and gives a definition generated from the metadata of the type.

If you know where the source code is, you can do this with a macro of a certain type or simply include it as a link to the project, rather than a link to the file.

0
source

All Articles