4

I'm extremely new to Dotpeek. Perhaps I'm missing something but everything seems to be in order:

The Modules I want are loaded: enter image description here

Everything appears good in Dotpeek: enter image description here

My breakpoints are set: enter image description here

Yet I keep getting this message when I land on a breakpoint in the decompiled pdb: enter image description here

The only reason I can think of is that this is Microsoft's proprietary software and they must have a way to keep people from doing this. Is this the case? If not, how can I get this working?

I have searched and found similar posts but the solutions aren't working here for some reason...

McCrockett
  • 159
  • 1
  • 9

2 Answers2

0

Creating source code from compiled code (DLLs) is a feature of dotPeek. Visual Studio does not have that feature.

Some tools can integrate in Visual Studio (such as Red Gate Reflector, a commercial tool), but AFAIK, dotPeek does not integrate into VS until now.

So, no, you can't see source code of arbitrary DLLs in Visual Studio.

We usually don't recommend software here, but perhaps dnSpy has what you're looking for: debugging and discompiling capabilities.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
0

Per the docs, you might have missed this step:

make sure to "In the Visual Studio options, go to the Debugging | General page and clear the Enable Just My Code checkbox.

Through trial and error, I have found that even with everything properly setup, creating a breakpoint manually with "New > Function Breakpoint" does not always work. The breakpoint triggers when expected, but I get "Source Not Available" as you do.

Workaround

My workaround is to find a way to step-in to where I need to be, then set the breakpoint normally (click gutter or F9). Sometimes I can do this from my own code, sometimes I have to find another method in the library where a manual breakpoint does work.

It's easy to tell whether a manual breakpoint is going to work, without even hitting it: with the debugger attached, after creaing the breakpoint using "New > Function Breakpoint", if "Language" and "File" are correct, it will work. Or when double-clicking the breakpoint, if it takes you to the file, it will work.

Details

Here's a comparison of my breakpoints, one set by stepping in, the other set manually. The one set manually shows no File, and when hit displays "Source Not Available": breakpoints-created

When I exported these breakpoints to XML, I notice the following differences:

Breakpoint that works (stepped-in, then set):

      <LocationType>SourceLocation</LocationType>
      ...
        <FileName>C:\Users\MyUser\AppData\Local\JetBrains\Shared\vAny\DecompilerCache\decompiler\7391115F-C184-4D01-A933-DF771669B14D\0f\2317d014\HttpCacheAttribute.cs</FileName>
      ...
      <BreakpointType>PendingBreakpoint</BreakpointType>

Breakpoint that doesn't work (manually created):

      <LocationType>NamedLocation</LocationType>
      ...
      <BreakpointType>BoundBreakpoint</BreakpointType>
      ...
      <ModuleName>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\e1238e8c\6a0ff27b\assembly\dl3\a01be3d2\00ba5bf4_8fe7d601\CacheCow.Server.WebApi.dll</ModuleName>
Johann
  • 4,107
  • 3
  • 40
  • 39