What's the grammar for AzureDevOps dotnet build
project path?
There is no special syntax for AzureDevOps dotnet build
project path, it just use relative path and wildcard.
When we use the task dotnet build
to build the project, we always the syntax **/*.csproj
to include all the project in specify branch of the repos. Assuredly, we could also use full path to specify the one project. For example:
In the get source task of the pipeline, we set the repos
and branch
:

Then, go to the repos
to get the relative path of the .net core
project:

So, the relative path of the .net core
project is /NetCoreLibDemo/NetCoreLibDemo/NetCoreLibDemo.csproj
, if you want only build the .net core project only:

How do I add more than one project for dotnet build
project path?
You can specify more than one project for dotnet build
project path by using **/*.csproj
or specify the .sln
file.
However, I have pointed out that if you are use the task dotnet pack rather than dotnet build
for more than one projects, you can make a pattern negative by prefixing it with -:
, like:

It works fine on my side, you can check if it works for you.
Update:
as I mentioned above, dotnet pack projects grammer did not work for
dotnet build, so wanna a grammar for dotnet build, that's the point of
the question
The grammar -:
is specify for dotnet pack. You could get it from states of the option:


So, just like I pointed above, if you want to specify more than one project for dotnet build
project path by using **/*.csproj
or specify the .sln
file.
Hope this helps.