title: Disable "Attach to debugger" Debugger.Launch
body: <p>I got a problem, i have accidentally left "Debugger.Launch();" code in my project, which was needed for the debugging as the application is a Windows Service. </p>
  
  <p>Now, i'am done with the projects, it´s working as intended (Mostly) <strong>BUT, every time you start the service, it asks if you want to attach a debugger.</strong> </p>
  
  <p>The Service has been packed to a MSI-package, and is more or less ready for delivery. And the guy who handles all the packaging and such is not at the office and none else know how to do it or has the authority to do it. </p>
  
  <p>Enough with the backstory.. </p>
  
  <ul>
  <li>Can i in any way disable the debugger code without repackaging the
  service? - Or do i have to repackage? </li>
  <li>Is there any startup command or something to prevent it to ask for
  debugger?</li>
  </ul>
  
  <p>I have been searching alot about this, but the most of the existing questions/posts about this regards "Prebuild" solutions, but i'am looking for a "Postbuild" solution.</p>
  
  <p>[EDIT]</p>
  
  <p>Solution (Some kind of..)</p>
  
  <p>I have still no idea if it is even possible to prevent attaching, but with the research i've done, it seems impossible. Therefore i had to recompile the service.</p>
  
  <p>As many of you that commented suggested i implemented a key in the app.config, and a simple "if-case" around the "Debugger.Launch()", which work perfectly. Now i can simply choose to attach debugger or not.</p>
  
  <p>Tamir Vereds solution worked on my local machine, and i did not even try on the customers server, because of the reason he also stated about base my code on this kind of tweaks. </p>
  
  <p>I will accept this answer, as it partly could fix the initial problem. </p>
  
  <p>Thank you all for answering.</p>