title: What causes an InvalidDeploymentException in a WPF application?
body: <p>I developed a WPF application and when I launch it in the debug mode I see the following in the output:</p>
  
  <blockquote>
    <p>'WpfApplication1.vshost.exe' (Managed
    (v2.0.50727)): Loaded
    'C:\WINDOWS\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll',
    Symbols loaded. A first chance
    exception of type
    'System.Deployment.Application.InvalidDeploymentException'
    occurred in System.Deployment.dll
    Additional information: Application
    identity is not set.</p>
  </blockquote>
  
  <p>If I use a control from this application in another WPF application, there are 7 such messages in the output. Nevertheless, the application works fine. </p>
  
  <p>Could you explain the reason why these exceptions thrown? I found that the method <code>ApplicationDeployment.get_CurrentDeployment</code> raises them. In the MSDN it is written that this exception arises when “You attempted to call this static property from a non-ClickOnce application.” I can’t understand what it means.</p>
  
  <p>I found similar post <a href="https://stackoverflow.com/questions/1894837/invaliddeploymentexception-application-identity-is-not-set">InvalidDeploymentException - Application identity is not set</a> but there is no answer to this question. </p>