Reputation: 128
I want to include some files from different project during publish. So for that in my file :
<Target Name="AfterBuild">
<CallTarget Targets="PublishWinService" />
</Target>
<Target Name="PublishWinService">
<Copy
SourceFiles ="$(SolutionDir)..\References\Test\**\*"
DestinationFolder="$(ProjectDir)" />
</Target>
But it gives me error saying that :
Unable to copy file "C:\PrakashSourceCode\Source\Abc ..\References\Test***" to "C:\PrakashSourceCode\Source\ Abc\Abc.web*". Illegal characters in path.
Now i changed it to:
<Copy SourceFiles="@(YourFilesToCopy)" DestinationFolder="C:\Test56\" />
<!--DestinationFolder="%(RecursiveDir)%(Filename)%(Extension)"-->
</Target>
But during publish iam not able to see files and during build i can see files.
Upvotes: 4
Views: 3430
Reputation: 3889
You may try if this simple solution works for you (It will only work if you can modify and save the .prj file):
Right Click on the file(s) which you want to publish -> Properties -> Copy to Output Directory.
The default value is Do not copy. Change this to Copy always or Copy if newer.
This will ensure that the file is in the build directory. You may pick it up from there.
Upvotes: 3