title: Visual Studio 2012 debugging of remote process not working as expected
body: <p>I am struggling with a rather difficult debugging challenge and hoping that someone might have some clues how to make this work.</p>
  
  <p>Here's the scenario:</p>
  
  <p>I have a C# Windows service that runs under a user account with admin privileges and launches a separate executable process under a user account that has standard user privileges. The two processes are designed to communicate using WCF.</p>
  
  <p>Unfortunately, when the child process is launched, it crashes immediately, with nothing in the event log that suggests what happened. The parent process continues running without exceptions.</p>
  
  <p>For information: these two applications work reliably together in a configuration whereby the parent process is a desktop application. I have also had success with the parent as a Windows service, but only when both processes run under the same user account with admin privileges.</p>
  
  <p>I now need to reconfigure their relationship to restrict the privileges of the child process, but this is when the crash occurs.</p>
  
  <p>In order to prove that what I am trying to do is feasible, I have created two stub applications and launched them successfully in the desired configuration. So, I can deduce that my real child app contains something that is incompatible with this configuration and which causes a crash even before the code starts executing. Unfortunately, since the child process is a based on some rather complex legacy code, it is not easy to isolate its elements until I eliminate the problem, so I really need a reliable means of stepping through it.</p>
  
  <p>If I modify the code of the child process to launch debugging immediately on startup, it invites me to attach a debugger, but fails to complete the attachment, with a message that indicates that <code>The Just-in-time debugger does not have permission to debug the process</code>.</p>
  
  <p>I have also seen <a href="https://stackoverflow.com/questions/4133164">this question</a> and attempted to implement <a href="https://stackoverflow.com/a/4145883/168614">this proposed solution</a> (which looks really promising) but it fails to work in my scenario. Instead of launching debugging prior to launching the application it appears to do nothing - niether the debugger nor the application are launched and the debugging invite dialog is not displayed. However, I have verified that this technique works in my environment (by using it to launch Notepad.exe) so there is clearly something about my application or the way that I am launching it that is causing the problem.</p>
  
  <p>I am happy to experiment and to share more details about my test results, if anyone has any suggestions.</p>
  
  <p>Many thanks for your ideas,</p>
  
  <p>Tim</p>