MsBuild copy file after build

前端 未结 3 1983
忘掉有多难
忘掉有多难 2020-12-15 18:20

I want to copy an xml file from the main directory to bin\\Debug after building the project, but my solution doesn\'t work. I edited .csproj file a

3条回答
  •  遥遥无期
    2020-12-15 18:45

    Your destination folder is (most likely) wrong. If you specify it with a leading backslash, it is actually just a shortform for \bin\Debug (making it effectively an absolute path, like C:\bin\Debug).

    Either use bin\Debug, or better yet use the OutputPath variable, which is set to either bin\Debug or bin\Release depending on your build configuration.

    Example:

    
         
    
    

提交回复
热议问题