I'm the new of c#
and visual studio. when I use the F12 to go to definition, but sometime it didn't work. it just showed me the a code without the body/logic of the methods.
Someone told me because of dll
, but I really don't know how to do can see the detailed code in this case. Thanks.
As others said, it's because all VS has to go on is the DLL, which doesn't contain the source, only method signatures.
But what can you do about it?
A few things.
This is because you didn't add reference as a project but you are pointing to a dll
or exe
using Browse tab in Add Reference dialog. If you add reference using Projects tab you should go directly to the source code when you select Go To Definition.
Note: If you do not have project for the
dll
then you will getmetadata
only fromdll
If your definition you are going to find using F12 is in the same project, then it will show total definition of method/variable/class.
If your definition is outside the project i,e you are referencing different project, then it will show only declaration.
如果尝试从编译的DLL中查看所引用方法的源代码,则不能,因为它是编译后的代码,因此不是源代码。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.