tag:help.appveyor.com,2012-11-13:/discussions/questions/12827-after-build-vs-post-build-event-in-csprojAppVeyor: Discussion 2018-08-25T02:21:10Ztag:help.appveyor.com,2012-11-13:Comment/439783482017-11-07T21:15:07Z2017-11-09T12:42:39Z[SOLVED]after build vs post-build event in csproj<div><p>I have a .net framework class library project which has no post-build events as part of the csproj yet.<br>
After build I want to run an exe that builds markdown from the built dll. I can do this successful locally with a post-build event on the csproj:</p>
<p>"$(ProjectDir)docgen\MarkdownGenerator.exe" "$(ProjectDir)bin\$(ConfigurationName)\ThreeLib.dll" "$(ProjectDir)docgen\docs"</p>
<p>Appveyor doesn't seem to like these post build events, and fails with an error:</p>
<p>"c:\projects\threelib\src\ThreeLib.csproj" (default target) (1) -> (PostBuildEvent target) -> C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command ""c:\projects\threelib\src\docgen\MarkdownGenerator.exe" "c:\projects\threelib\src\bin\Release\ThreeLib.dll" "c:\projects\threelib\src\docgen\docs"" exited with code 9009. [c:\projects\threelib\src\ThreeLib.csproj]</p>
<p>I don't need it to be in the csproj, I could just add it to appveyor.yml after_build (already doing a nuget pack there) as a ps or a cmd, but need a bit of help with that with regards to paths.</p></div>luistag:help.appveyor.com,2012-11-13:Comment/439783482017-11-07T22:44:08Z2017-11-07T22:44:08Z[SOLVED]after build vs post-build event in csproj<div><p>Try the following as <code>after_build</code> script:</p>
<pre>
<code>%APPVEYOR_BUILD_FOLDER%\docgen\MarkdownGenerator.exe %APPVEYOR_BUILD_FOLDER%\bin\%CONFIGURATION%\ThreeLib.dll %APPVEYOR_BUILD_FOLDER%\docgen\docs</code>
</pre>
<p>Or you can even remove <code>%APPVEYOR_BUILD_FOLDER%</code> if you do not change current directory during your build with <code>CD</code> command or so.</p>
<p>If this does not work (or you need to understand why original post-build event did not work) please send us a link to the failed build and build configuration in YAML format.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/439783482017-11-09T12:42:24Z2017-11-09T12:42:24Z[SOLVED]after build vs post-build event in csproj<div><p>Thank you for the reply. I was confused about using a prefix for the script. In the end, this worked:<br></p>
<pre>
<code>after_build:
- '%APPVEYOR_BUILD_FOLDER%\src\docgen\MarkdownGenerator.exe %APPVEYOR_BUILD_FOLDER%\src\bin\%CONFIGURATION%\ThreeLib.dll %APPVEYOR_BUILD_FOLDER%\src\docgen\docs'</code>
</pre></div>luistag:help.appveyor.com,2012-11-13:Comment/439783482017-11-09T17:56:20Z2017-11-09T17:56:20Z[SOLVED]after build vs post-build event in csproj<div><p>Good, thank you for update!</p></div>Ilya Finkelshteyn