0
votes

I am getting the following error:

Severity Code Description Project File Line Suppression State Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets. WoWonder D:\Compressed\wowonderandroid-162\codecanyon-19034167-wowonder-android-messenger-mobile-application-for-wowonder\Messnger_v1.6.2\WoWonder_Messenger\WoWonder.csproj 1064

Has anyone else faced this issue while trying to build a project?

2
Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named "What topics can I ask about here?" and "What types of questions should I avoid asking?". And more importantly, please read the Stack Overflow question checklist. You might also want to learn about Minimal, Complete, and Verifiable ExamplesLukas Novicky
Hi Suvooh, just checking-in to see if there's any update for this issue?LoLance

2 Answers

0
votes

This error occurs when you try to build a project that contains references to a missing NuGet package.

This probably means that the package is not installed in the global-packages folder or in the in the packages folder, or that the project file contains absolute paths and you have moved the project.

On this Microsoft Docs page you can find a detailed explanation for this issue and different ways to solve it.

0
votes

Apart from the tips in Alessandra's answer, also consider removing this script in your project file(xx.xxproj) if it exists:

  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
    <Error Condition="!Exists('..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets'))" />
  </Target>

Then make sure you've made these options checked:

enter image description here

Run a rebuild and this issue would go away. Hope it helps:)