How to get Prebuild commands in .csproj files to run?

TimEichfeld 20 Reputation points
2025-02-05T14:39:37.25+00:00

Hello,

I have a .sln file, that references a few .csproj files. I am using VSBuild@1 for my pipeline task.
One of the projects has a prebuild command. It runs fine if I build from Visual Studio, but the Azure DevOps VSBuild@1 task fails.

It is one commandline, with 4 seperate commands.

What would I need to do to get this working in Azure DevOps?

Any help would be much appreciated.

This is what is defined in my .csproj file


``

Here is the error log from Azure pipeline


2025-02-05T13:44:43.9070975Z PrepareForBuild:

2025-02-05T13:44:43.9071705Z Creating directory "bin\Release\net8.0\".

2025-02-05T13:44:43.9074194Z Creating directory "obj\Release\net8.0\".

2025-02-05T13:44:43.9076265Z Creating directory "D:\a\1\s\FileAccessLibrary\obj\Release\net8.0\refint\".

2025-02-05T13:44:43.9077786Z Creating directory "obj\Release\net8.0\ref".

2025-02-05T13:44:43.9116240Z PreBuild:

2025-02-05T13:44:43.9116617Z call "%vsappiddir%..\tools\vsdevcmd.bat"

2025-02-05T13:44:43.9116966Z pushd "D:\a\1\s\FileAccessLibrary\\Models\Xml\Schema"

2025-02-05T13:44:43.9117437Z xsd /c /n:FileAccessLibrary.Models.Xml 1.xsd 2.xsd 3.xsd 4.xsd 5.xsd 6.xsd 7.xsd 8.xsd

2025-02-05T13:44:43.9118228Z popd

2025-02-05T13:44:44.1166083Z The system cannot find the path specified.

2025-02-05T13:44:44.1310176Z 'xsd' is not recognized as an internal or external command,

2025-02-05T13:44:44.1311051Z operable program or batch file.

2025-02-05T13:44:44.1363066Z ##[error]FileAccessLibrary\FileAccessLibrary.csproj(17,5): Error MSB3073: The command "call "%vsappiddir%..\tools\vsdevcmd.bat"

pushd "D:\a\1\s\FileAccessLibrary\\Models\Xml\Schema"

xsd /c /n:FileAccessLibrary.Models.Xml 1.xsd 2.xsd 3.xsd 4.xsd 5.xsd 6.xsd 7.xsd 8.xsd

popd" exited with code 9009.

2025-02-05T13:44:44.1365640Z D:\a\1\s\FileAccessLibrary\FileAccessLibrary.csproj(17,5): error MSB3073: The command "call "%vsappiddir%..\tools\vsdevcmd.bat"

2025-02-05T13:44:44.1366004Z D:\a\1\s\FileAccessLibrary\FileAccessLibrary.csproj(17,5): error MSB3073: pushd "D:\a\1\s\FileAccessLibrary\\Models\Xml\Schema"

2025-02-05T13:44:44.1366466Z D:\a\1\s\FileAccessLibrary\FileAccessLibrary.csproj(17,5): error MSB3073: xsd /c /n:FileAccessLibrary.Models.Xml 1.xsd 2.xsd 3.xsd 4.xsd 5.xsd 6.xsd 7.xsd 8.xsd

2025-02-05T13:44:44.1366904Z D:\a\1\s\FileAccessLibrary\FileAccessLibrary.csproj(17,5): error MSB3073: popd" exited with code 9009.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,846 questions
0 comments No comments
{count} votes

Accepted answer
  1. VarunTha 12,190 Reputation points Microsoft Vendor
    2025-02-05T16:08:03.0366667+00:00

    Hi TimEichfeld,
    Thank you for reaching out to us on the Microsoft Q&A forum.

    Azure DevOps is currently not supported in the Q&A forums.

    I recommend initiating a new discussion through the Developer Community

    Moderators are readily available there to assist you and provide guidance.

    Please don't forget to Accept answer and close this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.