title: Reasons for getting the Program Compatibility Assistant dialog?
body: <p><strong>What are possible reasons for getting the Program Compatibility Assistant dialog after my application closes?</strong></p>
  
  <p><a href="https://i.stack.imgur.com/x1RWT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x1RWT.gif" alt="Program Compatibility Assistant image"></a><br>
  <sub>(source: <a href="http://i.msdn.microsoft.com/dynimg/IC5958.gif" rel="nofollow noreferrer">microsoft.com</a>)</sub>  </p>
  
  <p><strong>EDIT: <a href="https://support.microsoft.com/hub/4338813/windows-help" rel="nofollow noreferrer">Program Compatibility Assistant: frequently asked questions</a></strong></p>
  
  <p>I realize this question has already been asked on S.O.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1577412/program-compatibility-assistant-thinks-my-app-is-an-installer">Program Compatibility Assistant thinks my app is an installer</a></li>
  <li><a href="https://stackoverflow.com/questions/3069750/windows-7-program-compatibility-assistant-appeared-for-my-app-why">Windows 7 Program Compatibility Assistant appeared for my app. Why?</a></li>
  <li><a href="https://stackoverflow.com/questions/806017/why-i-receive-a-message-from-the-program-compatibility-assistant">Why I receive a message from the Program Compatibility Assistant?</a></li>
  <li><a href="https://stackoverflow.com/questions/1587962/how-do-i-prevent-programmatically-the-program-compatibility-assistant-in-vista">How do I prevent programmatically the “Program Compatibility Assistant” in Vista (and Windows 7) from appearing?</a></li>
  </ul>
  
  <p>However, my app:</p>
  
  <ol>
  <li>Only gets <em>PCA</em> after it closes</li>
  <li>Does not attempt to do anything that requires elevated privileges (I don't think)</li>
  <li>Does not get <em>PCA</em> when run from IDE</li>
  <li>Is not an installer/setup program</li>
  <li>Does not have "installer" or "setup" in the program name</li>
  <li>Does not throw an exception when it closes, or exit with a code other than 0 (I don't think)</li>
  <li>Does not get <em>PCA</em> if I add <code>&lt;compatibility&gt;</code> node to application manifest</li>
  </ol>
  
  <p>Note #6, with the following app.manifest, I no longer get the PCA:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;assemblyIdentity version="1.0.0.0" name="MyApplication.app"/&gt;
    &lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&gt;
      &lt;security&gt;
        &lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&gt;
          &lt;requestedExecutionLevel level="asInvoker" uiAccess="false" /&gt;
        &lt;/requestedPrivileges&gt;
      &lt;/security&gt;
    &lt;/trustInfo&gt;
    &lt;compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"&gt;
      &lt;application&gt;
        &lt;!--The ID below indicates application support for Windows Vista --&gt;
        &lt;supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/&gt;
        &lt;!--The ID below indicates application support for Windows 7 --&gt;
        &lt;supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/&gt;
      &lt;/application&gt;
    &lt;/compatibility&gt;
  &lt;/asmv1:assembly&gt;
  </code></pre>
  
  <p>So that second part seems to fix it, but I am worried that my application is still doing something that I am unaware of.</p>
  
  <p><strong>To be clear, I'm asking a 2 part question:</strong></p>
  
  <ol>
  <li><strong>What issues can cause the PCA dialog to appear?</strong></li>
  <li><strong>Is the <code>&lt;compatibility&gt;</code> node absolutely necessary in order to avoid the PCA dialog?  Or might I still be doing something wrong?</strong></li>
  </ol>