Copying files into the application folder at compile time

前端 未结 8 1171
无人共我
无人共我 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:52

    You can use a MSBuild task on your csproj, like that.

    Edit your csproj file

      <Target Name="AfterBuild">
        <Copy SourceFiles="$(OutputPath)yourfiles" DestinationFolder="$(YourVariable)" ContinueOnError="true" />
      </Target>
    
    0 讨论(0)
  • 2020-12-02 09:03

    I found this question searching for "copy files into the application folder at compile time". OP seems to have this sorted already, but if you don't:

    In Visual Studio right-click the file, select properties, then change the option 'copy to output' to 'always'. See http://msdn.microsoft.com/en-us/library/0c6xyb66.aspx

    0 讨论(0)
提交回复
热议问题