开发者

go to definition in VS 2010

开发者 https://www.devze.com 2023-01-26 19:15 出处:网络
what do I have to do to jump to the right class not the metadata? in visual studio 2010 while working on c# code I right click on some code to jump to \"Go To Definition\"

what do I have to do to jump to the right class not the metadata?

in visual studio 2010 while working on c# code I right click on some code to jump to "Go To Definition" sometimes shows the right class where my object is define and sometimes show m开发者_Python百科e the Metadata not the right class...

why is this ?

thanks for your help


It only shows you the source code of a class if that class is available in your solution. If you're referencing a project whose source you have, you can add it to the solution as a project reference, and "Go To Definition" should behave as you'd expect. If you're referencing a compiled DLL, "Go To Definition" will only display metadata.


if you added references to other project than F12 will go to the actual source code but for the DLL it will go to the meta data if defind


Visual Studio will go to the metadata when the reference is a DLL or an EXE - it doesn't "know" about the source code.

It will go to the source code when you have references a project.


As others have said, Visual Studio cannot show you the actual source code for an assembly that you only have in compiled form (i.e. .exe or .dll). If you really need to see how something was implemented, then you can use Reflector to decompile it for you, though the resulting code will probably be less intelligible than the original (no comments, variable names will be lost, etc.).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号