Web Deployment Error. Copy Files

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
 
M

Marc Gravell

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
 
S

shapper

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top