Reputation: 29
Is there a way to "Copy to Ouput Directory" a folder, not only a file.
I am developing a console application and i want to have a specific folder where the console application will write its logs.
For example, when i build my application in the ProjectName/bin/debug is the executable with all files it needs to run properly. I would like to have a folder there so when I zip this folder and send it to someone, he/she would not have to create it on his/her own. ( this is the folder where my application creates its logs
Every time i build the application I will have to create the folder automatically unless there is an option as "Copy to Ouput Directory" but for folders or something...
Upvotes: 0
Views: 1839
Reputation: 10343
You can do that via a post-build event. Right-click your project => properties => Build Events => "Post-build event command line". Use mkdir
in combination with the macros to get to your output directory.
Upvotes: 2