How to force MSBuild to copy empty folders in project?

后端 未结 2 898
滥情空心
滥情空心 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:46

    Do not edit the project file. I can see that you are using an older version on XSockets, Right?

    Do as Brenda says and do not mind the project file. Look at the image attached... build events

    Not 100% sure that it is this that you are looking for, but... it shows both pre- and post- build events

    Regards Uffe, Team XSockets

    0 讨论(0)
  • 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:

    
      <PropertyGroup>
        <PostBuildEvent>copy /Y "$(TargetDir)\*.*" "$(ProjectDir)\..\..\..\net40"</PostBuildEvent>
      </PropertyGroup>
    
    0 讨论(0)
提交回复
热议问题