Reputation: 48566
I currently have
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)Shared.Lib\$(TargetFileName)"</PostBuildEvent>
</PropertyGroup>
I want to do something like this, but one level above $(SolutionDir)
Upvotes: 17
Views: 18921
Reputation: 4096
In .Net Core edit csproj file:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y "$(TargetPath)" "$(SolutionDir)"..\"lib\$(TargetFileName)"" />
</Target>
/Y
Suppresses prompting to confirm you want to overwrite an existing destination file.
Upvotes: 1
Reputation: 1
xcopy "$(TargerDir)." "$(SolutionDir)..\Installer\bin\"
Note: "../" is used for One level up folder structure
Upvotes: -1
Reputation: 131
Solution:
copy "$(TargetPath)" "$(SolutionDir)"..\"Shared.Lib\$(TargetFileName)"
If you have ..\
within the quotation marks, it will take it as literal instead of running the DOS command up one level.
Upvotes: 13
Reputation: 1459
This is not working in VS2010 .. is not resolved but becomes part of the path
Studio is running command something like this copy drive$:\a\b\bin\debug drive$:\a\b..\c
Upvotes: 3
Reputation: 1614
You can use ..\ to move up a directory.
<PropertyGroup>
<PostBuildEvent>copy "$(TargetPath)" "$(SolutionDir)..\Shared.Lib\$(TargetFileName)"</PostBuildEvent>
</PropertyGroup>
Upvotes: 34