title: Installing a ClickOnce application from two different locations
body: <p>I have a Windows Forms application developed using C# in .NET framework 3.5, Service pack 1. The application can be published based on the development database as well as the production database. I am using MSBuild community tasks to publish my application. I do not face any problems while publishing the application to different location, namely a development location and a production location.</p>
  
  <p><strong>Issue:</strong></p>
  
  <ol>
  <li><p>After installing the development application into my machine, I am unable to install the production application. It gives me an error saying:</p>
  
  <blockquote>
    <p>You cannot start application TEST from this location
    because it is already installed from a different location</p>
  </blockquote></li>
  <li><p>Question: How does the machine understand that I am trying to install the same application? I assume it has some kind of an Application Id. If that's the case, I can override the concerned value based on the location. (DEV or PROD)</p>
  
  <p>The current code while publishing in the project file of my application:</p>
  
  <pre><code>&lt;Choose&gt;
      &lt;When Condition=" '$(BuildEnvironment)' == 'DEV' "&gt;
        &lt;PropertyGroup&gt;
          &lt;PublishDir&gt;\\A\B\development\&lt;/PublishDir&gt;
          &lt;BaseConnection&gt;Data Source=SQL-DEV.company.com; Database=TEST;Uid=XYZ;Pwd=ABC;&lt;/BaseConnection&gt;
  
        &lt;/PropertyGroup&gt;
      &lt;/When&gt;
  
      &lt;When Condition=" '$(BuildEnvironment)' == 'PROD' "&gt;
        &lt;PropertyGroup&gt;
          &lt;PublishDir&gt;\\A\B\production\&lt;/PublishDir&gt;
          &lt;BaseConnection&gt;Data Source=SQL-PROD.company.com;; Database=TEST;Uid=XYZ;Pwd=ABC;&lt;/BaseConnection&gt;
  
        &lt;/PropertyGroup&gt;
      &lt;/When&gt;
  &lt;/Choose&gt;
  </code></pre>
  
  <p>The publishing of the application works like a charm and points to the concerned database. All I want to do now is be able to install the development application as well as production application on the same machine without any errors.</p></li>
  <li><p>Question: What differentiates one click once application with the other?</p></li>
  </ol>