4

I have a Xamarin.Forms app. Yesterday, I updated Xamarin.Forms package to the latest version 4.8.0.1687. In Visual Studio 2019 I can build the app and run it. But build in Azure DevOps pipeline fails. For Android, the following error is reported:

C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file 'D:\a\1\s\My_MobileApp\My_MobileApp\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project. [D:\a\1\s\My_MobileApp\My_MobileApp\My_MobileApp.csproj]

Where My_MobileApp is the shared project.

I checked the project file, but the Target Framework there is set to .NET Standard 2.0. I checked the project.assets.json in the local obj folder, and it has

 "originalTargetFrameworks": [
    "netstandard2.0"
  ],

But no "TargetFrameworks".

What is wrong, and how this can be fixed?

0

1 Answer 1

2

Updating nuget to 5.8 worked for me

Sign up to request clarification or add additional context in comments.

1 Comment

Same. Make sure you don't specify a nuget version in "Use Nuget" task for latest version or specify it as 5.8.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.