title: Error while trying to run project: Access is denied
body: <p>Trying to Start a Winform solution <em>With Debugging</em> in Visual Studio 2017 causes this error:</p>
  
  <blockquote>
    <p>Error while trying to run project: Access is denied.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/8wFtn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8wFtn.png" alt="enter image description here"></a></p>
  
  <p>Running <em>Without Debugging</em> works and starts the project without the error.</p>
  
  <p><a href="https://i.stack.imgur.com/vPw1e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vPw1e.png" alt="enter image description here"></a></p>
  
  <p>This guy reported the same issue with a WPF project to Microsoft Developer Community (beta testing) but there is no solution: <a href="https://developercommunity.visualstudio.com/content/problem/39737/error-while-trying-to-run-project-unable-to-start-3.html" rel="nofollow noreferrer">https://developercommunity.visualstudio.com/content/problem/39737/error-while-trying-to-run-project-unable-to-start-3.html</a></p>
  
  <p>A <a href="https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx" rel="nofollow noreferrer">ProcessMonitor</a> Trace reveals its an Access Denied in the Registry:</p>
  
  <pre><code>39:45.7
  devenv.exe
  RegCreateKey    \REGISTRY\A\{3883977B-E889-4804-9494-B5A8BC8E3F1D}\Software\Microsoft\VisualStudio\15.0_8708a912\DialogPage
  ACCESS DENIED
  Desired Access: Maximum Allowed
  </code></pre>
  
  <p>Since its an Application Hive Registry Key it cannot be changed in RegEdit. <strong>UPDATE:</strong> You can change this, see my updated answer.</p>
  
  <p>How can I debug projects?</p>
  
  <p><sub>Note: Answering my own question to help others in the future.</sub></p>