0

I am trying to make an Azure CI/CD pipeline for the MAUI IOS application. I have gone through several articles and my final code is similar to the script explained in the below link.

https://dev.to/vhugogarcia/azure-devops-for-net-maui-using-yml-2f0o

I am facing an issue in the building or publishing application step.

I am getting below error,

Users/runner/hostedtoolcache/dotnet/sdk/7.0.306/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1005: Assets file '/Users/runner/work/1/s/SampleMAUIApp/SampleMAUIApp/obj/project.assets.json' doesn't have a target for '.net7.0-ios'. Ensure that restore has run and that you have included '.net7.0-ios' in the TargetFrameworks for your project.

A similar issue is also explained in the below link,

Assets file project.assets.json doesn't have a target for 'net6.0' - VS2022

As per one of the comments, someone also faced the same issue in the Azure pipeline and fixed it by restoring packages. The solution given in the link is

  • added in the "NuGet Tool Installer" task before the "NuGet Restore" task
  • Under the "Version of NuGet.exe to install", list the version you want to use, or the minimum version (e.g. >=6.1.0)
  • (this step is possibly overkill) Under the "NuGet Restore" Task, check "Disable local cache"

I tried to restore the packages using DotNetCoreCLI@2, NuGetCommand@2 after NuGetToolInstaller@1 step. In both the step, I am getting different errors. I have also tried with UseDotNet@2 dotnet restore, this is also not working.

What is the correct way to restore the packages? Do I need to change some configuration?

Thanks in advance for any help.

RMR
  • 599
  • 3
  • 12
  • 35
  • What is the command you're using for building? Specifically, are you trying to publish the sln file? If yes, try the csproj file. – Gerald Versluis Aug 08 '23 at 14:41

0 Answers0