Ohad Schneider
Ohad Schneider

Reputation: 38106

Make "Go to definition" navigate to the .NET reference source

In Resharper, there's an option to navigate to sources from symbol files. If I enable downloading, the navigation works - I can step into the code of Console.Writeline and so forth.

However, I have already downloaded the entire reference source - is there a way to direct Resharper to that source, so it doesn't download unnecessarily?

I've configured the reference source according to the instructions on the site

Upvotes: 4

Views: 1673

Answers (2)

David Schwartz
David Schwartz

Reputation: 2006

I was able to get this working with Visual Studio 2015 RTM and ReSharper v9.1.3 (and Visual Studio 2013). This is what I did...

NOTE: This is quirky. I'm not sure why, but sometimes the downloaded symbols have source code info in them and sometimes they don't. I had to repeatedly delete symbols from my cache and try to get the appropriate ones by attached the debugger to apps/websites and go to the Tools->Options->Debugging->Symbols and clicking Load All Symbols. I also did some source-stepping, and I had to copy the PDB files from my Symbol Cache into directories in the GAC and in C:\Program Files (x86)\Reference Assemblies. Finally, I went to the properties of the Visual Studio project and add F:\dd to the list of Reference Paths. I'm now able to right-click Navigate to Sources to most classes.

Short version:

  1. You have to use http://referencesource.microsoft.com/symbols as your symbol server instead of the default Microsoft Symbol Server
  2. The symbols expect to find the Reference Source files in F:\dd.
  3. Delete all cached symbols so it pulls them fresh from the newly added symbol server.

Long version:

  1. Configure Visual Studio according to the instructions found on the official .NET Reference Source site.
  2. Go to Visual Studio's Tools->Options->Debugging->Symbols, stop using Microsoft Symbol Servers and use the Reference Source Symbol Server (http://referencesource.microsoft.com/symbols) instead.

The Debugging->Symbols options panel.

  1. Delete all of your cached symbols! The PDBs in your cache do not have any information about the source code files. Visual Studio may have locked some of them, so you may have to close it first.
  2. Download the zipped up Reference Source file for the .NET Framework version you're working with.

  3. Here's the tricky part. The zip file you downloaded contains a folder called Source. The symbol files will expect that folder to be F:\dd. You can open up one of the PDBs retrieved from the new symbol server you added to see what I mean:

An image of a Reference Source PDB.

If you have an F:\ drive, it's easy: extract the Source folder from the zip file to F:\ and rename it to dd and you're good to go.

If you don't have an F:\ drive, you create an F:\ partition or load a virtual disk. I used a mapped network drive by extracting the Source folder into the shared folder C:\Code.

Sharing C:\Code

Then I mapped a network drive to \\MYPC\Code:

Map a network drive

I didn't want to rename the folder to dd, so I named it ReferenceSource and created a directory junction using Command Prompt (must run as Administrator):

cd C:\Code
mklink /j dd C:\Code\ReferenceSource

Voila. Now I have an F:\ drive mapped to C:\Code and a junction dd that points to C:\Code\ReferenceSource.

Upvotes: 2

shalupov
shalupov

Reputation: 131

It's not possible at the moment. Please vote/watch http://youtrack.jetbrains.net/issue/RSRP-126489

Upvotes: 2

Related Questions