4

I use Rider 2019.2.3 on the Ubuntu 18.10 with installed .NET SDK of version 3.1.100.

When I try to navigate to decompiled sources I sometimes see only declaration of the methods without their implementations, for example:

public static class IdentityServiceCollectionExtensions
{
    public static IdentityBuilder AddIdentity<TUser, TRole>(
      this IServiceCollection services)
      where TUser : class
      where TRole : class;
    ...
}

Rider took this source from the assembly /usr/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/3.1.0/ref/netcoreapp3.1/Microsoft.AspNetCore.Identity.dll. I inspect the IL code of it and it looks like this assembly contains only stubs for methods without their implementations.

So I have a couple of questions:

  1. What is the location of the actual assemblies of ASP.NET Core libraries on my computer?
  2. How can I force Rider to decompile actual assemblies?

My .csproj has Microsoft.NET.Sdk.Web SDK specified, so I thought that maybe I should install some special SDK for web development, but I can't find any information about this.

Peter B
  • 22,460
  • 5
  • 32
  • 69
Nikita Sivukhin
  • 2,370
  • 3
  • 16
  • 33

2 Answers2

1

The base path for the implementation assemblies is:

C:\Program Files\dotnet\shared\

I created a simple ASP.NET Core App and added your IdentityBuilder AddIdentity<TUser, TRole> function. When decompiled it couldn't get resolved automatically as well.

The actual assembly path for your case is:

C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.0\Microsoft.AspNetCore.Identity.dll

On Ubuntu it should be:

/usr/share/dotnet/shared/Microsoft.AspNetCore.App/3.1.0/Microsoft.AspNetCore.Identity.dll

Once i added this file manually to the decompiler i could step through the source code

If the path doesn't exist you might have to install the AspNetCore SDK for Ubuntu.

Charles
  • 2,721
  • 1
  • 9
  • 15
  • Yes, I also discovered the path to the assemblies. Actually, this library is a part of the ASP.NET Core runtime, so we can inspect directory with actual assemblies with the help of `dotnet --info` command. @charles, can you clarify, how you explicitly add an assembly to the decompiler? I use Rider and when I try to add explicit reference `` I get a warning from MSBuild that says, that reference can't be resolved. – Nikita Sivukhin Jan 05 '20 at 11:04
  • I just installed rider and source stepping including decompiling of the .NET Core project and your example function worked without me configuring anything. Imho it just downloads the symbol files from the microsoft servers automatically. The default settings are: `Tools->External symbols`: `Use sources`, `Allow downloading` and `Decompile methods` checked. – Charles Jan 05 '20 at 12:49
1

Navigation into decompiled method body in .NET Core 3.0 fixed in JetBrains Rider 2019.3. Please update your version to the latest available release.