.NET Core include folder in publish

后端 未结 4 876
时光说笑
时光说笑 2020-12-14 00:44

I have the following folder structure for my .NET Core 2.1 project:

How can I include folder AppData and all of its subfolders and files when I

4条回答
  •  难免孤独
    2020-12-14 01:23

    Adding this:

     
       
        PreserveNewest 
       
    
    

    to your .csproj file will copy AppData folder if it's not empty. For empty AppData folder you can use this workaround:

    
       
    
    

    This will create AppData folder after publish if it won't be already included in output. Meaning this will create AppData folder only if it's empty while publishing.

提交回复
热议问题