Select to view content in your preferred language

How to build ArcGIS Pro Configuration Solution via Command Line?

1029
2
Jump to solution
01-04-2023 11:26 AM
vijayk
by
New Contributor

Environment:

Windows, net6.0

Trying to setup Jenkins job to build ArcGIS Pro Configuration project. The solution compile successfully using Visual Studio 2022 but it fails to build the same solution via command line.

Steps to replicate:

(a) Start Visual Studio and create an Add-In project
(b) Build through Visual Studio menu
(c) It builds fine
(d) Open a command prompt in the same folder where solution (.sln) file exists
(e) Run the following command to build the solution:
     dotnet build {addin-solution}.sln
(f) Error occurs

"Error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild"

0 Kudos
1 Solution

Accepted Solutions
vijayk
by
New Contributor

Esri helped to find the solution for this problem.

The ArcGIS Pro solution can be built using MSBuild. "MSBuild.exe MySolution.sln -t:rebuild"

View solution in original post

2 Replies
DanielRouleau
New Contributor III

The reason dotnet build won't work is because the Esri.ProApp.SDK.Desktop.targets file uses CodeTaskFactory for the in-line tasks that package the esriAddinX file. To support dotnet build, Esri would need to change these to use RoslynCodeTaskFactory which is the logical successor to CodeTaskFactory. I've done as much on my local machine and it has worked well, but it is only a workaround.

I'd second the request to support this workflow now that Pro AddIns are written against .NET 6, particularly in the SDK nuget package.

vijayk
by
New Contributor

Esri helped to find the solution for this problem.

The ArcGIS Pro solution can be built using MSBuild. "MSBuild.exe MySolution.sln -t:rebuild"