Web Deployment Error. Copy Files

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have the following code:

<Target Name="AfterBuild">
<MakeDir Directories="$(OutputPath)\B" />
<Copy SourceFiles="$(OutputPath)\A\*.*" DestinationFolder="$
(OutputPath)\B" />
<RemoveDir Directories="$(OutputPath)\A" />

I get the following error:

"Unable to copy file ".\Debug\\A\*.*" to ".\Debug\\B\*.*". Illegal
characters in path"

Does anyone knows what is wrong?

I can't find the problem.

Thanks,

Miguel
 
well, you could try removing the \\, by using $(OutputPath)A and
$(OutputPath)B (note no \ between them), but I wonder if the problem
is the leading dot?
I don't know about msbuild, but in the old pre/post build events, you
can use $(TargetDir) to get the full path to the output folder - worth
a try? I'm not hopeful, though... but worth checking the msbuild docs
for an equivalent?

Marc
 
well, you could try removing the \\, by using $(OutputPath)A and
$(OutputPath)B (note no \ between them), but I wonder if the problem
is the leading dot?
I don't know about msbuild, but in the old pre/post build events, you
can use $(TargetDir) to get the full path to the output folder - worth
a try? I'm not hopeful, though... but worth checking the msbuild docs
for an equivalent?

Marc

Hi,

The equivalent is WDTargetDir. I tried:

<MakeDir Directories="$(WDTargetDir)B" />
<Copy SourceFiles="$(WDTargetDir)A\*.*" DestinationFolder="$
(WDTargetDir)B" />

I keep having an error but now this seems a bug. The error is:

Unable to copy file "C:\MyProject\Debug\A\*.*" to "C:\MyProject\Debug\B
\*.*".
Illegal characters in path.

See the destination folder. It also includes *.*. Isn't this strange?

Thanks,
Miguel
 
Back
Top