How to force MSBuild to copy empty folders in project?

后端 未结 2 903
滥情空心
滥情空心 2021-01-19 01:16

I have an MVC 4 project in Visual Studio 2012. There is Logs folder in it containing only four empty subfolders. This structure is needed by one library I use.

2条回答
  •  旧巷少年郎
    2021-01-19 01:49

    Add a PostBuild step to copy the folders.

    I can't answer specifically for VS2012, but here's how you do this in VS2010:

    • Right-click on the project and select Properties
    • Display the Build Events tab
    • Put your copy commands in the post-build event commands

    If you click the edit button, the pop-up dialog will have a macros button that lists all of the available VS variables you can use to avoid using explicit paths, etc.

    In VS2010, that modifies the project file to look something like this:

    
      
        copy /Y "$(TargetDir)\*.*" "$(ProjectDir)\..\..\..\net40"
      
    

提交回复
热议问题