Visual Studio Pre-build Event/Post-build Events Working Directory
Asked Answered
B

2

12

It's not clear from the documentation what the working directory is for pre-build or post-build events in Visual Studio. What is it? Where is this documented?

Bugger answered 25/5, 2017 at 3:6 Comment(0)
B
5

The working directory is the bin directory of the project.

I was unable to find documentation, but I tested this by making a post build event that made a directory. Then I checked where it was created.

Bugger answered 29/5, 2017 at 23:14 Comment(1)
More specifically, it is bin\$(ConfigurationName)\netcoreapp1.1 (or whatever your sdk resolves to).Hereof
I
12

For future reference, to find the execution directory, you could also enter:

"start cd"

in the Pre-Build event command line area.

This will open a command prompt in the current path after saving and triggering a build.

Also, the directory will be pointing in the \bin\debug|release.

Illiquid answered 8/9, 2018 at 11:22 Comment(1)
+1 I do not have a bin directory, but with this I was able to discover that the Pre-Build event's working directory is the one containing my *.vcxproj file.Whitcher
B
5

The working directory is the bin directory of the project.

I was unable to find documentation, but I tested this by making a post build event that made a directory. Then I checked where it was created.

Bugger answered 29/5, 2017 at 23:14 Comment(1)
More specifically, it is bin\$(ConfigurationName)\netcoreapp1.1 (or whatever your sdk resolves to).Hereof

© 2022 - 2024 — McMap. All rights reserved.