3

I'm using ReSharper 9.1.1 on Visual Studio 2013. On some classes, for example System.Data.SqlClient.SqlParameter when I right click on the word SqlParameter and click

Go to Definition

it directs me to some decompiled cs file

C:\Users\X\AppData\Local\JetBrains\Shared\v02\DecompilerCache\decompiler\D514DFA3-5BC8-4AE6-ABD0-D615A7C2893F\3c\1ec3bc9a\SqlParameter.cs

On the top of the file it says:

// Decompiled with JetBrains decompiler
// Type: System.Data.SqlClient.SqlParameter
// Assembly: System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: D514DFA3-5BC8-4AE6-ABD0-D615A7C2893F
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll

But on some other classes, for example System.DateTime when I right-click on DataTime and click Go to Definition, it directs me to this file:

C:\Users\X\AppData\Local\Temp\SymbolCache\src\Source\51209.34209\Source\ndp\clr\src\BCL\System\DateTime.cs

This file, it says;

//------------------------------------------------------------------------------
// copyright file="MessageBox.cs" company="Microsoft"
// Copyright (c) Microsoft Corporation. All rights reserved.
// /copyright
//-----------------------------------------------------------------------------

So this has come from Microsoft's reference source website, and the other decompiled with ReSharper.

Why some of the source code is decompiled and some of them downloaded from Miscoroft Reference Source? I want all of the sources come from Microsoft reference source website, not decompiled from .NET files.
They are the same in practice, but different in details. (comments, etc.)

  • In ReSharper Options, I've checked; Tools > External Sources > Navigation to Sources > Allow downloading from remote locations
  • In VS 2013 Options, I've checked; Debugging > Enable.NET Framework source stepping,
  • In VS 2013 Options, I've checked; Debugging > Enable source server support,
  • In VS 2013 Options, I've unchecked; Debugging > Enable Just My Code,
  • I've cleared ReSharper cache,
  • Deleted DecompilerCache folder C:\Users\X\AppData\Local\JetBrains\Shared\v02\DecompilerCache
  • I've installed dotPeek 1.4, tried with it,
  • Uninstalled dotPeek,
  • Uninstalled ReSharper, deleted C:\Users\X\AppData\Local\JetBrains\ folder and Reinstalled ReSharper again,
  • I've cleared solution with Visual Studio; Build > Clean Solution

How should I do to see only sources from http://referencesource.microsoft.com/ ?
Do we have any option to clear ReSharper's decompiled cache, and disable the decompile feature, until I have it enabled ?

Edit: I'm using .NET Framework 4.5.1 libraries.

UPDATE: As of Resharper 9.2 and Visual Studio 2015 and .NET Framework 4.6; nothing has changed for me. The problem still persists and it is happening to some other classes too. Is anything we can do on our side, like suppressing cached .cs files using the ones I prefer?

cagatay117
  • 33
  • 1
  • 7

1 Answers1

2

ReSharper will try to download a .pdb file for the assembly that's defining the type you're trying to view. But Microsoft don't have all .pdb files for all specific versions of all assemblies in the framework available to download - and if the .pdb isn't available, ReSharper falls back to decompiling the type.

The reference source site spent a long time not being updated, and many versions (especially for hot fixes and service packs) didn't get uploaded, and as more updates were released, more source wasn't available for download. As of .net 4.5.1, the current process for any update to the .net assemblies means the .pdb file (and source) is automatically uploaded to the reference source site, so it should work for more recent versions of assemblies. But if it's an earlier assembly (and I think there are some assemblies that aren't included in reference source), then it might not be available to download.

That said, it looks like there might be a ReSharper issue with this particular assembly. When trying to navigate to SqlParameter, ReSharper correctly downloads a system.data.pdb file, but fails to find any source information in it. Looking at the file, there does appear to be source information in there. I've raised an issue that you can vote and track - RSRP-440610.

citizenmatt
  • 18,085
  • 5
  • 55
  • 60
  • May I ask, where exactly the .pdb file located? I've taken a look to my Local folder AppData\Local\Symbols\ there are only .cs files. – cagatay117 Jun 01 '15 at 10:30
  • `%LOCALAPPDATA%\RefSrcSymbols\System.Data.pdb\8CAA24E603BB4B6EAA429528AE8799E81\System.Data.pdb`. ReSharper (annoyingly) puts a couple of caches directly in `%LOCALAPPDATA%` - `RefSrcSymbols` for .pdb files from referencesource.micrsoft.com, `SymbolSourceSymbols` for .pdb files from symbolsource.org and `Symbols` for other .pdb files and downloaded source. – citizenmatt Jun 01 '15 at 10:47
  • Is there any way to change this JetBrains\Shared\v02\DecompilerCache\decompiler\D514DFA3-5BC8-4AE6-ABD0-D615A7C2893F\3c\1ec3bc9a\SqlParameter.cs with the one I prefer? When I go to its definition, it will go the file I selected. – cagatay117 Jun 02 '15 at 14:40
  • I don't understand the question. Change what with what? That file is a cached, decompiled file. – citizenmatt Jun 02 '15 at 18:33
  • Change the decompiled file with some another cs file I want. I don't want to see that cached decompiled cs file. – cagatay117 Jun 03 '15 at 21:22
  • No, you can't substitute this file. It's a cache, maintained by the decompiler. – citizenmatt Jun 04 '15 at 13:48