0

I'm trying to place my compiled web application into a temporary directory after it has been built.

I have the following but it doesn't seem to work. It drops and create directors but the msbuild task doesn't seem to copy the compile output into the obj/publish directory that i need it to?

<Target Name="AfterBuild">
    <CallTarget Targets="Publish" />
  </Target> 
  <Target Name="Publish">
    <RemoveDir Directories="$(SolutionDir)AsycLearn\obj\publish\" ContinueOnError="true" />
    <MakeDir Directories="$(SolutionDir)AsycLearn\obj\publish\"/>
    <MSBuild Projects="AsycLearn.csproj" Targets="ResolveReferences;_CopyWebApplication" Properties="WebProjectOutputDir=$(SolutionDir) AsycLearn\obj\publish\;OutDir=$(SolutionDir) AsycLearn\obj\publish\bin\" />
  </Target>

any ideas? Thanks

Mantisimo
  • 4,203
  • 5
  • 37
  • 55

1 Answers1

0

It looks like you need to quote your output paths because they contain spaces. Otherwise the value that gets read will be truncated at the first space. That will also terminate the parameter set that gets passed to any other tasks.

Properties="WebProjectOutputDir=$(SolutionDir) AsycLearn\obj\publish\;OutDir=$(SolutionDir) AsycLearn\obj\publish\bin\"

should be

Properties="WebProjectOutputDir=&quot;$(SolutionDir) AsycLearn\obj\publish\&quot;;OutDir=&quot;$(SolutionDir) AsycLearn\obj\publish\bin\&quot;"

The escape sequence &quot; is needed because we want the resolved value to include quotes.

DaveE
  • 3,579
  • 28
  • 31