Copy files to output directory using csproj dotnetcore

前端 未结 7 1721
猫巷女王i
猫巷女王i 2020-11-29 20:54

So my issue is pretty simple. I have some files that I want to be copied to the build output directory whether it is a debug build or a release publish. All of the informati

7条回答
  •  天涯浪人
    2020-11-29 21:33

    Assuming you have an assets folder in your root directory. You can name it as you want. This is just an example:

    your-project.csproj

    
      
        
      
    
      
        
      
    
    

    this copies only the content of the assets folder to the output root without wrapping it into the assets folder. But if you want to copy with the folder itself, you can use the following code:

    
      
        
          PreserveNewest
        
      
    
    

提交回复
热议问题