问题
Is anyone aware of a method/tool that would allow me to browse the implementation of a method/type that comes from a NuGet package (by having the original PDBs or a URL of where to get them).
I am aware of SourceLink, and I am, in fact, using it. However, source linking is a debugger feature that allows it to download source code while debugging. I need to be able to browse my source code without debugging. (Say by hitting F12 on some method).
Weirdly, SourceLink downloads a copy of the original source, so I only need to link visual studio to point to the source file.
I tried using dotPeek from JetBrains, but I only manged to get it working as a symbol server, which is again helpful - but only while debugging.
回答1:
You should be able to do that with JetBrains Resharper.
If your code is using an interface from a NuGet assembly - or from any assembly that is not your own - you have to press F12 - Go to definition - on the method you are interested in. This will navigate to the source code of the interface.
Then, you have to Ctrl + F12 - Go to implementation - to go to the implementation(s) of that interface in this assembly.
As far as I know, you can't use Ctrl + F12 directly from your code, because it would only search for implementations in your code.
来源:https://stackoverflow.com/questions/49507450/net-go-to-implementation-of-a-nuget-package