0

I have asked a question previously on how to build a UWP app on all 3 platforms when there are platform-dependent dlls on the project. The solution is a success but now I have an issue with the automated build on Azure DevOps.

On the DevOps CI setup,

/p:AppxBundlePlatforms="x86|ARM|x64" 
/p:AppxPackageDir="C:\agent\_work\4\a\AppxPackages\\" 
/p:AppxBundle=Always  
/p:UapAppxPackageBuildMode=StoreUpload
/p:PackageCertificateThumbprint="" 
/p:PackageCertificateKeyFile="C:\agent\_work\_temp\BoardPACWinApp_TemporaryKey.pfx" 
/p:platform="x86"
/p:configuration="release"
/p:VisualStudioVersion="16.0"
/p:_MSDeployUserAgent="TFS_22ec7900-72ed-4ebd-b5a6-d4ba51a210dd_build_16_0"

enter image description here

/p:platform="x86" part affecting my build and the error msg is looking like this: (Focus on the "x86" part which comes from platform variable)

2019-10-01T14:15:58.4153083Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): error MSB3270: There was a mismatch between the processor architecture of the project being built "ARM" and the processor architecture of the reference "IronOne.FileConverter.Windows, Version=2.0.0.0, Culture=neutral, processorArchitecture=ARM", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\agent_work\4\s\Main\BoardPACWinAppUtil\BoardPACWinAppUtil.csproj]

The above error happening when the app is building the ARM platform. x86 platform build goes success and the x64 is pending by the time this error happens.

How do I overcome this and build all 3 platforms of the app to submit to the Microsoft Store?

Thanks in advance for the time and effort.

SurenSaluka
  • 1,534
  • 3
  • 18
  • 36
  • Hi, It seems the reference IronOne.FileConverter.Windows is not support for `Any-CPU`, so if you use it to generate a appxupload support for all 3 platforms (x86, x64, ARM), it will throw the mismatch between the processor architecture error. This seems to be the key to this issue. Have you tried to package separately for `x86` or `ARM` except `x64`? – Leo Liu Oct 03 '19 at 09:06
  • Yes, I have 3 separate dlls to support all 3 platforms. I have added pre build command to copy each file to a common directory when building via VS. But with DevOps I’m having trouble because in “Platform” I can mention only 1 build platform. But in “AppxBundlePlatform” supports all3 platforms. – SurenSaluka Oct 03 '19 at 10:46
  • In VS what happen is based on the platform relevant dll is copied to the common folder which has the project reference so I can publish the app is all platforms. In DevOps this cannot do so if I say x64 when the app is building x86 it copies the wrong dll to the common folder. – SurenSaluka Oct 03 '19 at 10:49
  • I have a better explanation over here: https://developercommunity.visualstudio.com/content/problem/757622/uwp-app-build-all-3-platforms-using-azure-devops-c.html – SurenSaluka Oct 04 '19 at 08:19

0 Answers0