Similarly to this question, but rather than creating a file if it doesn't exist - I want to create a folder, if it doesn't exist.
MSBuild create folder if folder does not exists
To create a folder if folder does not exists, you can use the below xml code:
<Target Name="MakeMyDir" AfterTargets="PrepareForBuild">
<MakeDir Directories="$(ProjectDir)Newfolder" Condition="!Exists('$(ProjectDir)Newfolder')" />
</Target>
Newfolder is the name of your created folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With