views:

84

answers:

0

I'm use msbuild for deploy my applications, using VS 2008, windows xp

It appears this errors:

warning MSB4011: There is a circular reference involving the import of file.

error MSB4006: There is a circular dependency in the target dependency graph involving target "Install".

ScriptDespliegue.Targets file call to task from $(MSBuildProjectName).targets file.

What have I done:

1.) deploy.cmd

@echo off

SET FrameworkDir=%windir%\Microsoft.NET\Framework

SET FrameworkVersion=v2.0.50727

SET PATH=%windir%\Microsoft.NET\Framework\v2.0.50727;%PATH%

MSBuild ScriptDespliegue.Targets @ScriptDespliegue.Targets.rsp

2.) ScriptDespliegue.Targets file

<Project InitialTargets="Install" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  <Import Project="Microsoft.Sdc.Common.tasks"/>
  <Import Project="Reale.LifeCycle.tasks"/>
  <Import Project="$(MSBuildProjectName).targets"/>

  <Target Name="InicializandoInstalacion">
    <Message Text="Entorno: $(Entorno), Grupo: $(Grupo) y Servidor: $(Servidor)..." />
    <CallTarget Targets="DespliegueOrdenado" ContinueOnError="false"></CallTarget>
  </Target>

  <Target Name="Install" DependsOnTargets="InicializandoInstalacion">
  </Target>

</Project>

3.) $(MSBuildProjectName).targets file

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;

    <Import Project="Reale.LifeCycle.tasks"/>
    <Import Project="$(MSBuildBinPath)\Microsoft.Common.targets"/>

<PropertyGroup>
<SqlDespliegueTargetOrdenados>DesplegarFicheroSql0;DesplegarFicheroSql1;DesplegarFicheroSql2;DesplegarFicheroSql3;DesplegarFicheroSql4;DesplegarFicheroSql5</SqlDespliegueTargetOrdenados>
</PropertyGroup>

<Target Name="DesplegarFicheroSql0">
    <Exec Command="osql.exe &quot;CarpetaUno\TextFile1.sql&quot;" />
</Target>

<Target Name="DesplegarFicheroSql1">
    <Exec Command="osql.exe &quot;TextFile10.sql&quot;" />
</Target>

<Target Name="DesplegarFicheroSql2">
    <Exec Command="osql.exe &quot;TextFile1.sql&quot;" />
</Target>

<Target Name="DesplegarFicheroSql3">
    <Exec Command="osql.exe &quot;CarpetaUno\TextFile2.sql&quot;" />
</Target>

<Target Name="DesplegarFicheroSql4">
    <Exec Command="osql.exe &quot;Carpeta Dos\TextFile1.sql&quot;" />
</Target>

<Target Name="DesplegarFicheroSql5">
    <Exec Command="osql.exe &quot;Carpeta Dos\TextFile2.sql&quot;" />
</Target>

<Target Name="DespliegueOrdenado" DependsOnTargets="SqlDespliegueTargetOrdenados">
</Target>

</Project>

any solution ? I want to have two targets files.