SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Copy config post build

Last post 02-16-2008 2:28 AM by Dal Hit. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 06-27-2006 11:01 PM

    Copy config post build

    Friends,

    I'm having trouble coming up with the correct command to copy all the miscalaneous Enterprise library config files to the build directory: This is what I've got up to ( I've tried dozens of others )

    copy "$(MSBuildProjectDirectory)\*.config" "$(MSBuildProjectDirectory)\$(OutDir)"

    Could someone help ?

    TIA ;)

  • 06-28-2006 12:50 PM In reply to

    Re: Copy config post build

    Here's a PostBuildEvent MSBuild project that Daniel created to copy some Boo files to the output folder:

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <PrepareForRunDependsOn>$(PrepareForRunDependsOn);MyPostBuildTarget</PrepareForRunDependsOn>
      </PropertyGroup>
      <ItemGroup>
        <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\booc.*" />
        <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\*.targets" />
        <MyCopyItem Include="$(MSBuildProjectDirectory)\..\..\RequiredLibraries\Boo.Microsoft.Build.Tasks.dll" />
      </ItemGroup>
      <Target Name="MyPostBuildTarget">
        <Copy SourceFiles="@(MyCopyItem)" DestinationFolder="$(OutputPath)" />
      </Target>
    </Project>


  • 06-28-2006 1:15 PM In reply to

    Re: Copy config post build

    Hi Matt,

    Many thanks for your reply however I get the following error :

    error MSB3073: The command "copy.xml" exited with code 1.

    The problem would seems to be that the $(OutputPath) is blank. Can anyone point me to a resource which lists all the properties available in SharpDevelop.

    Thanks again.
  • 06-28-2006 1:42 PM In reply to

    Re: Copy config post build

    I am not sure how you're using your MSBuild project, but this is how the Boo project works. There is a main project (BooBinding.csproj) that imports a MSBuild project to do the post build (PostBuildEvent.proj)

    The OutputPath property is set by the main BooBinding.csproj:

    <PropertyGroup>
        <OutputPath>..\AddIns\BackendBindings\BooBinding\</OutputPath>
    </PropertyGroup>


    The PostBuildEvent.proj file is imported into the main BooBinding.csproj via:

      <Import Project="PostBuildEvent.proj" />

  • 06-28-2006 1:49 PM In reply to

    Re: Copy config post build

    Cheers mate, worked a charm.

    But it would be nice if there was a way to do it with the post-build event command line instead of manually editing the project files. I'm not complaining though, if it works it works.

    Many thanks
  • 06-28-2006 2:43 PM In reply to

    Re: Copy config post build

    You can use a post-build event command line to do it, but depending on where this command line lives inside the MSBuild project file certain properties may not be defined. Unfortunately SharpDevelop puts the command line near the start of the MSBuild project file so OutputPath is not defined at this point. Visual Studio puts the post build command line at the end of the project. I'll have raised a bug report about this.
  • 06-28-2006 3:14 PM In reply to

    Re: Copy config post build

    Thanks for all your help, much appreciated.
  • 02-16-2008 2:28 AM In reply to

    Re: Copy config post build

    Hi Dude, i am coming accross similar problem.

    I have VS 2005 with .NET 2,3,3.5. on Win 2K3 Entp Edtn

    In post build event, i am running below command
    copy "$(ProjectDir)Tests\Microsoft.Practices.EnterpriseL ibrary.Configuration.dll.config" "$(TargetDir)"

    But it exits with following error:

    Error 71 The command "copy 'C:\_Src\LPO_ECM\HERMESDEV01_EcmBuild\Sources\Sour ce\EnterpriseLibrary\Configuration\Tests\Microsoft .Practices.EnterpriseLibrary.Configuration.dll.con fig' 'C:\_Src\LPO_ECM\HERMESDEV01_EcmBuild\Sources\Sour ce\EnterpriseLibrary\Configuration\bin\ReleaseFina l\'" exited with code 1. Configuration.prod


    Even i replace above Macro-Directories with actual path, as below, but still i am getting error.

    copy "C:\_Src\LPO_ECM\HERMESDEV01_EcmBuild\Sources\Sourc e\EnterpriseLibrary\Configuration\Tests\Microsoft. Practices.EnterpriseLibrary.Configuration.dll.conf ig" "C:\_Src\LPO_ECM\HERMESDEV01_EcmBuild\Sources\Sourc e\EnterpriseLibrary\Configuration\bin\ReleaseFinal \"


    Also i cheked that Source folder has necessary files & destination folder is writtable.

    I am not able to understand what wrong here..!!!

    In case anyone can throw some light on this issue,
    please reply me : dal_hit@yahoo.com

    Thanks
    Dal Hit
Page 1 of 1 (8 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.