To copy files in different location after the build is published, I tried the following:
Editing the csproj file, and adding this code, copies the dlls to bin of the relative path.
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="CustomCollectFiles">
<ItemGroup>
<_CustomFiles Include="..\*project*\**\*.dll" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
This works absolutely fine. I was just wondering if this can be done using post build events something like this.. ( this doesnt work).
if $(ConfigurationName) == Release xcopy /y "$(ProjectDir)$(OutDir)$(TargetFileName)" "$(SolutionDir)$(OutDir)"
Is the first way is the "only way of doing it" with oneclick publish in VS2010? The concern being, the changes in the csproj files will not be shown anywhere, in VS2010.