I have a scenario where I have to change the OutputPath
in .csproj file after the build.
I'd like to know if there is any way to do this in post build events.
Asked
Active
Viewed 150 times
0

Marco
- 56,740
- 14
- 129
- 152

Pavan Navali
- 242
- 3
- 14
-
why do not just copy all builded stuff into a new directory after successful build ? – Tigran Sep 03 '12 at 19:09
-
Why you need this? Just prepare OutputPath for the next build? – sll Sep 03 '12 at 19:10
2 Answers
1
You could have a post build event that modifies the .csproj itself to change the value of OutputPath in a (or all) configuration(s) with a python script or whatever, but modifying the .csproj invalidates the current build, meaning if you press F5 or F7 again, it will build the project again because VS thinks the project itself has changed, again and again.

Romz
- 544
- 4
- 16
0
If I understand correctly you just want the build product in another directory,
so two quick options: 1. In the post build event simply copy your files:
xcopy $(TargetDir) <destination>
- Change the project build path all-together: In Project Properties -> Build -> "Output path"
Hope this helps

Eyal H
- 991
- 5
- 22