0

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.

Marco
  • 56,740
  • 14
  • 129
  • 152
Pavan Navali
  • 242
  • 3
  • 14

2 Answers2

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>
  1. Change the project build path all-together: In Project Properties -> Build -> "Output path"

Hope this helps

Eyal H
  • 991
  • 5
  • 22