Copying files into the application folder at compile time

前端 未结 8 1210
无人共我
无人共我 2020-12-02 08:25

If I have some files I want to copy from my project into the .\\bin\\debug\\ folder on compilation, then it seems I have to put them into the root of the projec

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 08:39

    Personally I prefer this way.

    Modify the .csproj to add

    
        
          PreserveNewest
          %(Filename)%(Extension)
        
    
    

    or generalizing, if you want to copy all subfolders and files, you could do:

    
        
          PreserveNewest
          %(RecursiveDIr)\%(Filename)%(Extension)
        
    
    

提交回复
热议问题