Last post Jan 08, 2008 12:52 PM by feio
Jan 08, 2008 11:39 AM|feio|LINK
I'm having a problem while copying my output files, i'm using this:
<Target Name= "AfterBuild" >
< Copy SourceFiles= "$(OutputPath)*.ascx" DestinationFolder="..\MYFOLDER" />
< /Target >
But i'm receiving this:
Unable to copy file "MYOUTPUTFOLDER\*.ascx" to "..\MYFOLDER\*.ascx". Illegal characters in path.
I don't understand what i'm doing wrong.
Can anyone help me with this?
Jan 08, 2008 12:29 PM|utlandsfantomenno1|LINK
I'm guessing the star in "MYOUTPUTFOLDER\*.ascx" is interpreted as a filename and not the way you wan't it interpreted, as a wildcard character.
I'm further guessing you'd have to loop through all files and then copy them, on a per name basis.
Jan 08, 2008 12:33 PM|feio|LINK
That's an ideia, but i hope the last i'll try.[:S]
I have too many files, for it to be a maintainable
Thanks any way [;)]
Jan 08, 2008 12:52 PM|feio|LINK
Ok, I found a solution:
I create an ItemGroup first, where I specify the files to be copied, then I use that ItemGroup in the copy statement:
2 <MyFiles Include="MYOUTPUTFOLDER\*.ascx; MYOUTPUTFOLDER\*.aspx"/>
5 <Target Name="AfterBuild">
6 <Copy SourceFiles="@(MyFiles)" DestinationFolder="..\MYFOLDER" />
It's working. I'm assuming that it wasn't working because of what utlandsfantomenno1 said, and had nothing to do with Illegal characters
Thanks a lot, anyway.
itemgroup copy sourcefiles