Nuget package restore error in build definition - tfs

I'm getting this error when building a project​ using Visual Studio online service build:
Error:
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 ....\Attempt17\.nuget\NuGet.targets.
It is giving that nuget.target file is missing but it is already present in .nuget folder.
Any help?

You should add a "Nuget Package Restore" task to your build before you run your compilation. You no longer need a ".nuget" folder.

I had a different cause, in VSTS/Azure DevOps using "Use Nuget" first then "NuGet restore" second, on Hosted agent...the restore was throwing this error. Error began showing sometime around Feb 1, 2019.
I had to change this...
Path to solution, packages.config, or project.json: **/*.sln
to this...
Path to solution, packages.config, or project.json: **\{YOUR_SOLUTION_NAME}.sln
And the error went away.
Hope this helps!

Related

Receiving error while creating project with Razor page template

Immediately I click on create and the project loads. I always receive the below error. I cannot do anything without correcting this.
This is the error:
Severity Code Description Project File Line Suppression State
Error NETSDK1004 Assets file 'C:\Users\HARBIORLAR PC\Desktop\VB Web Projects\BookList\BookList\BookList\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. BookList C:\Program Files\dotnet\sdk\3.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 234
Screen shot of the error:
This is what i did and it works,I Enable automatic package restore by choosing Tools > Options > NuGet Package Manager, and then selecting Automatically check for missing packages during build in Visual Studio under Package Restore.
Then I build the project with internet connection on and the missing file was downloaded.
This the Screen shot After successful

I can not build the generated Android project by Zebble

I am getting the following error when building the android project generated by Zebble for Xamarin.
I followed the steps in -READ-ME-NOW!!!!!!!!!!!! text file. When I did build the android project, this is error I got:
The command "Zebble" update-schema auto" exited with code -1.
Some additional error log I found from Build output:
EXEC : error : Failed to update the xml schema for intellisense: Failed to find the UWP exe file. Searched all EXE files inside: E:\Labs.NET\Xamarin\TestZebble\TestZebbleApp\Run\UWP\bin
Could you please tell me what has gone wrong.
Hope this helps:
Remove all zebble folders from nuget packages folder.
Remove the Run\Android\Zebble.exe file.
Update the zebble nuget to latest version.
Set the Android project as startup project.
From Build > Configuration Manager be sure that Build and Deploy are enabled for android project.
Rebuild the solution.

Unable to restore nuget packages with "WARNING: Invalid parameter" error

I'm trying to build a Xamarin Android project at my build server (Mac OS X) but I'm unable to restore some of nuget packages (3 or 22). These three packages can be downloaded but for some reason couldn't be copied to the workspace.
I cleaned the workspace, removed nuget cache - same result.
Restoring NuGet package Xamarin.GooglePlayServices.Gcm.29.0.0.1.
Restoring NuGet package modernhttpclient.2.4.2. Restoring NuGet
package Xamarin.GooglePlayServices.Analytics.29.0.0.1. Adding package
'Xamarin.GooglePlayServices.Analytics.29.0.0.1' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
Adding package 'Xamarin.GooglePlayServices.Gcm.29.0.0.1' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
Adding package 'modernhttpclient.2.4.2' to folder
'/Volumes/Storage/Jenkins/jobs/Build1/workspace/packages'
WARNING: Invalid parameter WARNING: Invalid parameter WARNING: Invalid
parameter
After a restart and packages folder cleanup it started to work fine. Just use -Verbosity detailed command to get more insights on an issue:
https://docs.nuget.org/consume/command-line-reference
Take into account that the install, update and restore commands has different way to define verbose level of output.

fatal error: 'Fabric/Fabric.h' file not found

I am working on xcode 6.3.1, OSX 10.10.3 and I have configure crashlytics successfully with my local system. it work fine and it release the build via fabric app. But when I transfer same codebase to teamcity it was showing me following error
fatal error: 'Fabric/Fabric.h' file not found
fatal error: 'Crashlytics/Crashlytics.h' file not found
After investigation, I found that following unknown issue in my teamcity server. Teamcity got the source from git and when I see the source code in teamcity, Crashlytics.framworks & fabric.framworks are available but when you look into folder structure it could not figure out shortcuts for all headers, modules, resources, crashlytics folder (pic-1).
I get the other git clone in other folder and manually pull source code, here I can see the all shortcuts for crashlytics & fabrics sub folders. (pic-2).
I just copied all folders and pasted in teamcity source code. Now it works but every time when source code changed, teamcity reset to non-shortcut folder structure which will fail my builds. I am not sure this is GIT issue or teamcity or crashlytics issue. Please let me know how to figure out. I appreciate you answers.
Thanks
Manoj
Its a Teamcity configuration issue.
When you include libraries, if using git to get the code you have to change the Version Control Settings.
Change VCS checkout mode to Automatically on agent. This will fix your issue. There is a problem with the teamcity git client which messes up the symlinks so the libraries dont actually download correctly.

How to restore Nuget package

I have added solution into TFS.
Now other users have taken latest that solution project.
Problem: all users are facing an issue for Ninject and other references are not found which are added through Package manager.
Please guide me.
I tried to apply - "Nuget Restore" command in package console but, it says, command not exists.
Please help how to resolve.
I always run the the following in Nuget package manager console:
Update-Package -reinstall -ProjectName testProject
When something like what you mentioned happens. Make sure instead of testProject you put your testProject

Resources