Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Go To Implementation of a NuGet package

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.

like image 610
Hentov Avatar asked Mar 27 '18 08:03

Hentov


People also ask

Where do NuGet packages go?

The global-packages folder is where NuGet installs any downloaded package. Each package is fully expanded into a subfolder that matches the package identifier and version number. Projects using the PackageReference format always use packages directly from this folder.

How do I open a NuGet package?

Quickly find and install a package Open your project or solution in Visual Studio, and select Tools > NuGet Package Manager > Package Manager Console to open the Package Manager Console window.

How use NuGet package in asp net?

Open your Visual Studio application. On the Tools menu, select Options. Expand the NuGet Package Manager and select Package Sources. Click the Add button (green plus), and enter the 'Package Name' and 'Package Source URL' of the Syncfusion ASP.NET Web Forms NuGet packages.


1 Answers

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.

like image 148
Daniel Hilgarth Avatar answered Sep 29 '22 02:09

Daniel Hilgarth