[{"data":1,"prerenderedAt":89},["ShallowReactive",2],{"/2025/12/27-msbuild-copy-task-afterbuild-vs2019":3},{"id":4,"title":5,"body":6,"date":80,"description":49,"extension":81,"meta":82,"navigation":83,"path":84,"robots":85,"seo":86,"stem":87,"__hash__":88},"posts/2025/12/27 MSBuild-copy-task-AfterBuild-VS2019.md","27 MSBuild Copy Task AfterBuild VS2019",{"type":7,"value":8,"toc":77},"minimark",[9,18,25,28,31,33,36,50,53,61,64],[10,11,13],"post-title",{":date":12},"date",[14,15,17],"h1",{"id":16},"msbuild-copy-task-afterbuild-vs2019","MSBuild Copy Task AfterBuild VS2019",[19,20,21],"notes",{},[22,23,24],"p",{},"This is a repost from my old blog. First posted in 11/11/2020.",[26,27],"br",{},[22,29,30],{},"This time the issue is with MSBuild task that I set up in one of my project (in the project file). The task is to copy the dll to a different location after build is done. I copied the configuration over to a different project and guess what, it didn't work.",[26,32],{},[22,34,35],{},"It worked flawlessly for a very long time with the following configuration:",[37,38,39],"code-block",{},[40,41,46],"pre",{"className":42,"code":44,"language":45},[43],"language-text","\u003CTarget Name=\"AfterBuild\">\n  \u003CCopy SourceFiles=\"...\" DestinationFolder=\"...\" />\n\u003C/Target>\n","text",[47,48,44],"code",{"__ignoreMap":49},"",[22,51,52],{},"Two main differences between the two projects are the working on is a .NET Framework project and built in VS2017. The new one is a .NET Standard and built in VS2019. Apparently, there is a change for VS2019 that comes with updated MSBuild. It is no longer depends on the target name (it is a bad idea anyway) to determine when to execute the task. I update it to the following and then it works great.",[37,54,55],{},[40,56,59],{"className":57,"code":58,"language":45},[43],"\u003CTarget Name=\"AnyNameIsFine\" AfterTargets=\"Build\">\n  \u003CCopy SourceFiles=\"...\" DestinationFolder=\"...\" />\n\u003C/Target>\n",[47,60,58],{"__ignoreMap":49},[22,62,63],{},"For reference:",[22,65,66],{},[67,68,71],"span",{"className":69},[70],"text-blue-600",[72,73,74],"a",{"href":74,"rel":75},"https://docs.microsoft.com/en-us/visualstudio/msbuild/copy-task?view=vs-2019",[76],"nofollow",{"title":49,"searchDepth":78,"depth":78,"links":79},2,[],"2025-12-27T00:00:00.000Z","md",{},true,"/2025/12/27-msbuild-copy-task-afterbuild-vs2019",null,{"title":5,"description":49},"2025/12/27 MSBuild-copy-task-AfterBuild-VS2019","aoPrkEIHWTTMLsNWAVqQUy8-wPikSKBqXCZnpzq8Vow",1785167452049]