[SOLVED]after build vs post-build event in csproj

luis's Avatar


07 Nov, 2017 09:15 PM

I have a .net framework class library project which has no post-build events as part of the csproj yet.
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:

"$(ProjectDir)docgen\MarkdownGenerator.exe" "$(ProjectDir)bin\$(ConfigurationName)\ThreeLib.dll" "$(ProjectDir)docgen\docs"

Appveyor doesn't seem to like these post build events, and fails with an error:

"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]

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.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 07 Nov, 2017 10:44 PM

    Ilya Finkelshteyn's Avatar

    Try the following as after_build script:

    %APPVEYOR_BUILD_FOLDER%\docgen\MarkdownGenerator.exe %APPVEYOR_BUILD_FOLDER%\bin\%CONFIGURATION%\ThreeLib.dll %APPVEYOR_BUILD_FOLDER%\docgen\docs

    Or you can even remove %APPVEYOR_BUILD_FOLDER% if you do not change current directory during your build with CD command or so.

    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.

  2. 2 Posted by luis on 09 Nov, 2017 12:42 PM

    luis's Avatar

    Thank you for the reply. I was confused about using a prefix for the script. In the end, this worked:

      - '%APPVEYOR_BUILD_FOLDER%\src\docgen\MarkdownGenerator.exe %APPVEYOR_BUILD_FOLDER%\src\bin\%CONFIGURATION%\ThreeLib.dll %APPVEYOR_BUILD_FOLDER%\src\docgen\docs'
  3. Support Staff 3 Posted by Ilya Finkelshte... on 09 Nov, 2017 05:56 PM

    Ilya Finkelshteyn's Avatar

    Good, thank you for update!

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:21 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac


22 Aug, 2019 08:13 PM
21 Aug, 2019 11:06 PM
21 Aug, 2019 02:08 PM
21 Aug, 2019 01:37 PM
21 Aug, 2019 10:21 AM
21 Aug, 2019 05:56 AM