Home
%3CLINGO-SUB%20id%3D%22lingo-sub-806167%22%20slang%3D%22en-US%22%3EDevOps%20for%20.Net%20Core%2F.Net%20Standard%3A%20Common%20CI%20Issues%20Solving%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-806167%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERecently%20got%20chances%20to%20work%20on%20%3CA%20href%3D%22https%3A%2F%2Fportal.azure.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20DevOps%3C%2FA%3Efor%20Desktop%20(UWP%2FWPF%2FDesktop%20Bridge%2FMSIX)%20%2C%20and%20often%20need%20to%20CI%2FCD%20.Net%20Core%20and%20.Net%20Standard.%20Most%20of%20them%20are%20related%20to%20SDK%20setup%2C%20NuGet%20version%20update%2C%20TargetPlatform%20settings%2C%20or%20Code%20Sign%20Certificate%20trust.%20This%20article%20is%20to%20give%20quick%20references%20on%20how%20to%20solve%20common%20CI%20issues%20for%20this%20scenario.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ENETSDK1045%3A%20The%20current%20.NET%20SDK%20does%20not%20support%20targeting%20.NET%20Core%202.2.%20Either%20target%20.NET%20Core%202.1%20or%20lower%2C%20or%20use%20a%20version%20of%20the%20.NET%20SDK%20that%20supports%20.NET%20Core%202.2.%3C%2FLI%3E%0A%3CLI%3EError%20%3A%20Unable%20to%20locate%20the%20.NET%20Core%20SDK.%20Check%20that%20it%20is%20installed%20and%20that%20the%20version%20specified%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Ftools%2Fglobal-json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eglobal.json%3C%2FA%3E(if%20any)%20matches%20the%20installed%20version.%3C%2FLI%3E%0A%3CLI%3EMSB4236%3A%20The%20SDK%20%E2%80%98Microsoft.NET.Sdk.WindowsDesktop%E2%80%99%20specified%20could%20not%20be%20found.%3C%2FLI%3E%0A%3CLI%3EWMC0621%3A%20Cannot%20resolve%20%E2%80%98GenXbf.dll%E2%80%99%20under%20path%20%E2%80%98C%3A%5CProgram%20Files%20(x86)%5CWindows%20Kits%5C10%5Cbin%5C10.0.17134.0%5Cx86%5Cgenxbf.dll%E2%80%99.%3C%2FLI%3E%0A%3CLI%3ENU1201%3A%20Project%20%5Bxxxx%5D%20is%20not%20compatible%20with%20uap10.0.17134%20(UAP%2CVersion%3Dv10.0.17134).%20Project%20%5Bxxxx%5D%20supports%3A%20netstandard2.0%20(.NETStandard%2CVersion%3Dv2.0)%3C%2FLI%3E%0A%3CLI%3EAPPX0102%3A%20A%20certificate%20with%20thumbprint%20%E2%80%98320245B47FCFxxxxx692C7A9A4729xxxxx6FE4%E2%80%99%20that%20is%20specified%20in%20the%20project%20cannot%20be%20found%20in%20the%20certificate%20store.%20Please%20specify%20a%20valid%20thumbprint%20in%20the%20project%20file.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ENETSDK1045%3C%2FSTRONG%3E%3A%20The%20current%20.NET%20SDK%20does%20not%20support%20targeting%20.NET%20Core%202.2.%20Either%20target%20.NET%20Core%202.1%20or%20lower%2C%20or%20use%20a%20version%20of%20the%20.NET%20SDK%20that%20supports%20.NET%20Core%202.2.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIt%20is%20possible%20project%20targeted%20.Net%20Core%20version%20is%20different%20from%20the%20Build%20Agent%20environment.%20The%20direct%20method%20is%20to%20install%20.Net%20Core%20SDK%20accordingly%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20373px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127104iB0B5942F7FD0A892%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%221.png%22%20title%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20go%20to%20site%3A%20%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F2.2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F2.2%3C%2FA%3Eto%20install%20.Net%20Core%202.2%20SDK%20for%20the%20self-host%20build%20agent.%20The%20issue%20will%20be%20solved.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlternatively%2C%20you%20can%20also%20add%20.Net%20Core%20SDK%20Install%20task%20into%20build%20pipeline%20yml%20file%20if%20it%20is%20can%20be%20downloaded%20properly%20through%20DevOps%20pipeline.%20Open%20azure-pipelines.yml%2C%20in%20the%20right%20pane%2C%20we%20can%20easily%20add%20a%20task%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20482px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127103iF93517A1CB9C88E8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222.png%22%20title%3D%222.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20278px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127102iFC2ED5B16642C386%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223.png%22%20title%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3ENote%3A%20you%20need%20to%20add%20SDK%20accurate%20version%20number%2C%20refer%20to%20the%20version%20list%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F2.2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F2.2%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F3.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdotnet.microsoft.com%2Fdownload%2Fdotnet-core%2F3.0%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20your%20project%20is%20WPF%20and%20is%20ported%20to%20.Net%20Core%2C%20the%20error%20can%20be%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EError%20%3A%20Unable%20to%20locate%20the%20.NET%20Core%20SDK.%20Check%20that%20it%20is%20installed%20and%20that%20the%20version%20specified%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Ftools%2Fglobal-json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eglobal.json%3C%2FA%3E(if%20any)%20matches%20the%20installed%20version.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EMSB4236%3C%2FSTRONG%3E%3A%20The%20SDK%20%E2%80%98Microsoft.NET.Sdk.WindowsDesktop%E2%80%99%20specified%20could%20not%20be%20found.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127113i988F234868978CA1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%224.png%22%20title%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUse%20the%20above%20methods%20to%20add%20.Net%20Core%20SDK%20can%20fix%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWMC0621%3C%2FSTRONG%3E%3A%20Cannot%20resolve%20%E2%80%98GenXbf.dll%E2%80%99%20under%20path%20%E2%80%98C%3A%5CProgram%20Files%20(x86)%5CWindows%20Kits%5C10%5Cbin%5C10.0.17134.0%5Cx86%5Cgenxbf.dll%E2%80%99.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWhen%20project%20target%20platform%20doesn%E2%80%99t%20match%20the%20build%20agent%20environment%2C%20this%20error%20message%20can%20happens.%20To%20fixed%20it%2C%20change%20Min%20or%20Target%20Platform%20versions.%20I%20set%20this%20for%20my%20VS2019%20%2B%2019H3%20agent%20environment%20and%20this%20issue%20got%20fixed%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20510px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127106i768F1D8010E12040%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%225.png%22%20title%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_4%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3ENU1201%3C%2FSTRONG%3E%3A%20Project%20%5Bxxxx%5D%20is%20not%20compatible%20with%20uap10.0.17134%20(UAP%2CVersion%3Dv10.0.17134).%20Project%20%5Bxxxx%5D%20supports%3A%20netstandard2.0%20(.NETStandard%2CVersion%3Dv2.0)%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWhen%20Azure%20DevOps%20builds%20one%20.Net%20Standard%20project%20(here%20it%20is%20WebRTC%20for%20UWP)%2C%20I%20hit%20this%20error%20message%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENU1201%3A%20Project%20%5Bxxxx%5D%20is%20not%20compatible%20with%20uap10.0.17134%20(UAP%2CVersion%3Dv10.0.17134).%20Project%20%5Bxxxx%5D%20supports%3A%20netstandard2.0%20(.NETStandard%2CVersion%3Dv2.0)%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_5%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127109iF3176D669416AA0A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%226.png%22%20title%3D%226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20because%20the%20default%20NuGetToolInstaller%20installed%20an%20old%20NuGet%20version%204.3.0%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Etask%3A%20NuGetToolInstaller%400%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_6%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127108iE03D58CEF933360C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%227.png%22%20title%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20old%20NuGet%20version%20doesn%E2%80%99t%20support%20.Net%20Standard%202.0%20with%20UWP.%20To%20solve%20this%2C%20we%20need%20to%20set%20the%20NuGet%26nbsp%3B%20tool%20version%20to%20higher%20version.%20In%20my%20environment%2C%20I%20explicitly%20set%20it%20as%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fnuget%2Frelease-notes%2Fnuget-5.2-rtm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E5.2.0%3C%2FA%3Ein%20azure-pipelines.yml%EF%BC%9A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20191px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127107i390F27F43534F27C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_7%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3EAnd%20then%20this%20issue%20was%20fixed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAPPX0102%3C%2FSTRONG%3E%3A%20A%20certificate%20with%20thumbprint%20%E2%80%98XXXXXXXXXX%E2%80%99%20that%20is%20specified%20in%20the%20project%20cannot%20be%20found%20in%20the%20certificate%20store.%20Please%20specify%20a%20valid%20thumbprint%20in%20the%20project%20file.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20may%20face%20such%20a%20error%20when%20perform%20CI%20in%20Azure%20DevOps%20for%20UWP%20project%20due%20to%20some%20reasons%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%23%23%5Berror%5DC%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20Visual%20Studio%5C2019%5CEnterprise%5CMSBuild%5CMicrosoft%5CVisualStudio%5Cv16.0%5CAppxPackage%5CMicrosoft.AppXPackage.Targets(4432%2C5)%3A%20Error%20APPX0102%3A%20A%20certificate%20with%20thumbprint%20%E2%80%98320245B47FCFxxxxx692C7A9A4729xxxxx6FE4%E2%80%99%20that%20is%20specified%20in%20the%20project%20cannot%20be%20found%20in%20the%20certificate%20store.%20Please%20specify%20a%20valid%20thumbprint%20in%20the%20project%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20key%20point%20is%20to%20install%20the%20PFX%20on%20the%20agent%20properly%20for%20signing%20UWP%20package.%20There%20are%20some%20ways%20to%20workaround%20this%20in%20Azure%20DevOps%20default%20agent%20through%20scripts.%20For%20me%20it%20is%20convenient%20to%20have%20one%20self-host%20build%20agent%20so%20that%20I%20can%20easily%20import%20this%20certificate%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20to%20have%20a%20self-host%20agent%2C%20go%20through%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdevops%2Fpipelines%2Fagents%2Fv2-windows%3Fview%3Dazure-devops%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdevops%2Fpipelines%2Fagents%2Fv2-windows%3Fview%3Dazure-devops%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FWindows-Dev-AppConsult%2FDevOps-for-Desktop-How-to-use-Self-Hosted-agent-for-Win10-UWP%2Fba-p%2F774553%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EDevOps%20for%20Desktop%3A%20How%20to%20use%20Self-Hosted%20agent%20for%20Win10%20UWP%20Desktop%20Apps%20in%20Azure%20DevOps%20Pipeline%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EUse%20a%20power%20shell%20script%20to%20export%20pfx%20from%20your%20dev%20box%20if%20necessary%20(for%20example%2C%20VS%20may%20just%20add%20the%20cert%20to%20Cert%20Store%20and%20pfx%20is%20not%20under%20your%20project)%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%24pwd%20%3D%20ConvertTo-SecureString%20-String%20%E2%80%9Cyourpassword%E2%80%9D%20-Force%20-AsPlainText%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExport-PfxCertificate%20-cert%20%E2%80%9CCert%3A%5CCurrentUser%5CMy%5Cxxxxxxxxxx692C7A9Axxxxxxxx6FE4%E2%80%9D%20-FilePath%20c%3A%5Ctemp_StoreKey.pfx%20-Password%20%24pwd%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EOn%20the%20self-host%20agent%2C%20open%20certmgr.msc%2C%20install%20the%20temp_StoreKey.pfx%20to%20current%20user%2Fmy%20path%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_8%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20552px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F127114i59C6245B69522FBE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%229.png%22%20title%3D%229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EQueue%20Build%20again%2C%20the%20issue%20will%20be%20resolved.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks!%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-806167%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20font-family%3A%20'SegoeUI'%2C'Lato'%2C'Helvetica%20Neue'%2CHelvetica%2CArial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3ERecently%20got%20chances%20to%20work%20on%20%3C%2FSPAN%3E%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23146cac%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20underline%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20href%3D%22https%3A%2F%2Fportal.azure.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20DevOps%3C%2FA%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20font-family%3A%20'SegoeUI'%2C'Lato'%2C'Helvetica%20Neue'%2CHelvetica%2CArial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3Efor%20Desktop%20(UWP%2FWPF%2FDesktop%20Bridge%2FMSIX)%20%2C%20and%20often%20need%20to%20CI%2FCD%20.Net%20Core%20and%20.Net%20Standard.%20Most%20of%20them%20are%20related%20to%20SDK%20setup%2C%20NuGet%20version%20update%2C%20TargetPlatform%20settings%2C%20or%20Code%20Sign%20Certificate%20trust.%20This%20article%20is%20to%20give%20quick%20references%20on%20how%20to%20solve%20common%20CI%20issues%20for%20this%20scenario.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

 

Recently got chances to work on Azure DevOps for Desktop (UWP/WPF/Desktop Bridge/MSIX) , and often need to CI/CD .Net Core and .Net Standard. Most of them are related to SDK setup, NuGet version update, TargetPlatform settings, or Code Sign Certificate trust. This article is to give quick references on how to solve common CI issues for this scenario.

 

  • NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.
  • Error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
  • MSB4236: The SDK ‘Microsoft.NET.Sdk.WindowsDesktop’ specified could not be found.
  • WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86\genxbf.dll’.
  • NU1201: Project [xxxx] is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Project [xxxx] supports: netstandard2.0 (.NETStandard,Version=v2.0)
  • APPX0102: A certificate with thumbprint ‘320245B47FCFxxxxx692C7A9A4729xxxxx6FE4’ that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file.

 

NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2.

 

It is possible project targeted .Net Core version is different from the Build Agent environment. The direct method is to install .Net Core SDK accordingly:

 

1.png

 

Then go to site: https://dotnet.microsoft.com/download/dotnet-core/2.2 to install .Net Core 2.2 SDK for the self-host build agent. The issue will be solved.

 

Alternatively, you can also add .Net Core SDK Install task into build pipeline yml file if it is can be downloaded properly through DevOps pipeline. Open azure-pipelines.yml, in the right pane, we can easily add a task:

 

2.png3.png

 

Note: you need to add SDK accurate version number, refer to the version list:

 

https://dotnet.microsoft.com/download/dotnet-core/2.2

https://dotnet.microsoft.com/download/dotnet-core/3.0

 

If your project is WPF and is ported to .Net Core, the error can be this:

 

Error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.

 

MSB4236: The SDK ‘Microsoft.NET.Sdk.WindowsDesktop’ specified could not be found.

 

4.png

 

Use the above methods to add .Net Core SDK can fix them.

 

WMC0621: Cannot resolve ‘GenXbf.dll’ under path ‘C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86\genxbf.dll’.

 

When project target platform doesn’t match the build agent environment, this error message can happens. To fixed it, change Min or Target Platform versions. I set this for my VS2019 + 19H3 agent environment and this issue got fixed:

 

5.png

 

NU1201: Project [xxxx] is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Project [xxxx] supports: netstandard2.0 (.NETStandard,Version=v2.0)

 

When Azure DevOps builds one .Net Standard project (here it is WebRTC for UWP), I hit this error message:

 

NU1201: Project [xxxx] is not compatible with uap10.0.17134 (UAP,Version=v10.0.17134). Project [xxxx] supports: netstandard2.0 (.NETStandard,Version=v2.0)

 

6.png

 

This is because the default NuGetToolInstaller installed an old NuGet version 4.3.0

 

task: NuGetToolInstaller@0

 

7.png

 

The old NuGet version doesn’t support .Net Standard 2.0 with UWP. To solve this, we need to set the NuGet  tool version to higher version. In my environment, I explicitly set it as 5.2.0 in azure-pipelines.yml:

 

8.png

 

And then this issue was fixed.

 

APPX0102: A certificate with thumbprint ‘XXXXXXXXXX’ that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file.

 

You may face such a error when perform CI in Azure DevOps for UWP project due to some reasons:

 

##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v16.0\AppxPackage\Microsoft.AppXPackage.Targets(4432,5): Error APPX0102: A certificate with thumbprint ‘320245B47FCFxxxxx692C7A9A4729xxxxx6FE4’ that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file.

 

The key point is to install the PFX on the agent properly for signing UWP package. There are some ways to workaround this in Azure DevOps default agent through scripts. For me it is convenient to have one self-host build agent so that I can easily import this certificate:

 

Note: to have a self-host agent, go through:

 

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops

 

DevOps for Desktop: How to use Self-Hosted agent for Win10 UWP Desktop Apps in Azure DevOps Pipeline

 

  1. Use a power shell script to export pfx from your dev box if necessary (for example, VS may just add the cert to Cert Store and pfx is not under your project):

$pwd = ConvertTo-SecureString -String “yourpassword” -Force -AsPlainText

 

Export-PfxCertificate -cert “Cert:\CurrentUser\My\xxxxxxxxxx692C7A9Axxxxxxxx6FE4” -FilePath c:\temp_StoreKey.pfx -Password $pwd

 

  1. On the self-host agent, open certmgr.msc, install the temp_StoreKey.pfx to current user/my path:
 

9.png

 

  1. Queue Build again, the issue will be resolved.

 

Thanks!