title: Debugging native C++ code, called from managed C# library, executed by another app
body: <p>I have the following setup: Third-party app (Autodesk Revit) executes my C# library thru C# Revit API (the library is Revit addon, named <strong>csapi</strong>). Then, my C# library calls another C++ native library (<strong>libbrowserhost-client-capid.dll</strong>) thru PInvoke.</p>
  
  <p>My goal is to debug the native library in Visual Studio. I have either the C++ source and the symbols.</p>
  
  <p>I am already able to debug it, if I rebuild my C# plugin lib as an executable and call the unmanaged library directly from the executable. In Visual Studio <em>Output</em> window I see  the following:</p>
  
  <pre><code>'csapi.exe' (Win32): Loaded 'D:\Documents\Visual Studio 2017\Projects\browserhost-csharp-api\BrowserhostCSharpApi\bin\x64\Debug\libbrowserhost-client-capid.dll'. Symbols loaded.
  </code></pre>
  
  <p>The problem comes, when Revit becomes the first in the executing chain. The debugger omits native PInvoke calls (like Step Over). <em>Output:</em></p>
  
  <pre><code>...
  'Revit.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Ondra\AppData\Local\Temp\RevitAddins\csapi-Executing-20180318_200947_6493\csapi.dll', Symbols loaded.
  'Revit.exe' (Managed (v4.0.30319)): Loaded 'C:\Program Files\Autodesk\Revit 2018\MessageLogger.dll'
  'Revit.exe' (Managed (v4.0.30319)): Loaded 'C:\Program Files\Autodesk\Revit 2018\log4net.dll'
  ...
  </code></pre>
  
  <p>But I can see no <strong>libbrowserhost-client-capid.dll</strong> loaded there.</p>
  
  <p>First, this is an output of what? The debugger or the dynamic linker or whatever? Second, how do I achieve to load <strong>libbrowserhost-client-capid.dll</strong> to the Revit process to be able to debug it? Is it possible to load the DLL to VS debugger somehow manually?</p>