Note that there are some explanatory texts on larger screens.

plurals
  1. POMSBuild & SQL Server Database Project: bind the deploy and publish desination to the build configuration
    primarykey
    data
    text
    <p>Visual Studio 2012. SQL Server Database Project. </p> <p>Four build configurations were created in solution: Debug, DevDb, TestDb, LocalDb.</p> <p>Three publish profiles were created in project: DevDb.publish.xml, TestDb.publish.xml, LocalDb.publish.xml</p> <p><strong>Pushing F5 button (!)</strong> I want to:</p> <ul> <li><strong>deploy</strong> project with connection string from project properties <strong>if</strong> build configuration is <strong>Debug</strong>. </li> <li><strong>publish</strong> project with connection string from the corresponding publish profiles <strong>if</strong> build configuration is <strong>DevDb</strong>, <strong>TestDb</strong> or <strong>LocalDb</strong>.</li> </ul> <p>To do this I edit project (.sqlproj) xml, trying to catch a call of the Deploy target and replace the standart Deploy target with a custom behavior:</p> <pre><code>&lt;Target Name="Deploy"&gt; &lt;!-- The first statment is for Debug configuration --&gt; &lt;MSBuild Condition=" '$(Configuration)' == 'Debug' " Targets="Deploy" Projects="$(MSBuildProjectFile)" Properties="Configuration=$(Configuration);" /&gt; &lt;!-- The second statement is for DevDb, TestDb, LocalDb configurations --&gt; &lt;MSBuild Condition=" '$(Configuration)' != 'Debug' " Targets="SqlPublish" Projects="$(MSBuildProjectFile)" Properties="SqlPublishProfilePath=$(Configuration).publish.xml; Configuration=$(Configuration);" /&gt; &lt;/Target&gt; </code></pre> <p>The second statement works fine and I get deployment to the right destination.</p> <p>The problem is with the first statement - it produces a circular dependency.</p> <p><em>error MSB4006: There is a circular dependency in the target dependency graph involving target "Deploy".</em></p> <p>My question is: how to intersect (catch and replace) the standart target and if it's required to invoke the standart target again?</p> <p>Or am I trying to reinvent the wheel and there is another way to do what I want? (What I want is described above under words "Pushing F5 button" :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload