MSIX Azure DevOps MSIX Build and Package task failing on latest image 20210525.0. Error NETSDK1004

Copper Contributor

Is anyone else using Azure Devops Pipelines to create their MSIX?

 

Starting 27th May as the Build Agent pool started to update to the latest image are MSIX build pipeline started to fail on MSIX Build and Package task. As of last week we have a 100% failure rate. 

 

I've reported it as an issue here but I'm surprised not to see more people reporting it as an issue. I've tried it with two different solutions and get the same result with both. 

 

The error is "error NETSDK1004: Assets file 'D:\a\8\s\xxxxxx.Packager\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\a\8\s\xxxxxx.Packager\xxxxxxx.Packager.wapproj]."

 

Running the same command line with the latest version of MSBuild locally is fine. 

 

2 Replies

@JulesB Please add a Nuget Restore task to your pipeline to fix this issue. The MSIX Packaging build task does not do that automatically.

Obviously given the error message that's the first thing I did but it didn't fix the issue. Also should be pointed out that prior to the 20210525.0 Azure agent image coming into play that error did not occur. I have build less than 10 minutes apart where the one on the previous image succeeded and the one on that image failed. Nothing had changed between builds, other than the image they ran on, I literally just re-queued it as I initially thought it was a glitch and then the next build worked as it happened to run on on agent using the previous image.

If you look on the linked issue I created on Github (https://github.com/actions/virtual-environments/issues/3501) you can see in the end the answer was to run a Build task before the Build and Package task with the MS Build parameter /t:Restore. Unfortunately it took me 14 days to work this out as it wasn't obvious to me and I only hit on it due to a comment on a out of date blog post from 3 years ago about .Net core which my project isn't.