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"
Solved! Go to Solution.
Esri helped to find the solution for this problem.
The ArcGIS Pro solution can be built using MSBuild. "MSBuild.exe MySolution.sln -t:rebuild"
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.
Esri helped to find the solution for this problem.
The ArcGIS Pro solution can be built using MSBuild. "MSBuild.exe MySolution.sln -t:rebuild"
FYI, I've created an Idea to move to `dotnet build`. Feel free to Kudo it so Esri knows that devs really want it. https://community.esri.com/t5/developers-ideas/enable-dotnet-build-for-arcgis-pro-add-ins-and/idi-p/...