Raj More
Raj More

Reputation: 48048

SSIS (missing) Pre-Build and Post-Build

For the warehouse work under progress, we have a single solution with multiple projects in it

  1. OLTP Database Project
  2. Warehouse Database Project
  3. SSIS ETL project

After the SSIS project is built, I want to move the binaries (XML, really) from the Bin folder to "C:\AutomatedTasks\ETL.Warehouse\" and "C:\AutomatedTasks\ETL"

I cannot find the Post-Build events to do that for the SSIS project. Where are they? If they aren't available, how do I achieve this?

Upvotes: 1

Views: 857

Answers (1)

Mehmet Aras
Mehmet Aras

Reputation: 5374

When you specify pre- and post-build events via VS IDE, VS adds two MSBuild properties to the underlying project file: PreBuildEvent and PostBuildEvent. I don't know much about how SSIS projects get built but you can try to manually edit the project file and add those properties along with the commands you need:

<PropertyGroup>
  <PostBuildEvent>copy "$(TargetDir)someoutput.xml" "C:\AutomatedTasks\ETL\someoutput.xml"</PostBuildEvent> 
</PropertyGroup>   

You can also take a look at some of the other VS macros to see if they already capture what you need. For example, you may be able to use $(TargetPath) and $(TargetFileName) instead of hardcoding someoutput.xml if someoutput.xml is the target output.

copy "$(TargetPath)" "C:\AutomatedTasks\ETL\$(TargetFileName)"

Upvotes: 1

Related Questions