##[error]The given path's format is not supported - nuget

I am trying to setup build definition in TFS 2015 .WHen i try to setup build ,it's failing and giving below error:
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'.
12. 2017-03-31T13:59:36.1211815Z ##[error]The given path's format is not supported.
13. 2017-03-31T13:59:36.1368100Z ##[error]Unexpected exit code 1 returned from tool NuGet.exe
I tried selecting restore nuget package as well as everything I could do but I am not getting which path's format is being fetched. Please help me.

This error is similar to Nuget 3.4+ can not restore some packages fails with "The given path's format is not supported"
First, please check nuget.config and make sure nuget can find packages from your sources. Besides if you are using Nuget 3.4.x, give a try with version 3.5.0-rtm-1829

Related

How to create a Nuget Package in ADO Pipeline

Using the Classic DevOps, I am trying to create a NuGet package out of one of our code libraries.
I am Using NuGet version 5.9.1
I am able to do a NuGet restore of the 'Newtonsoft.Json.13.0.1.nupkg' dependency. The task succeeds without an error:
[![enter image description here][1]][1]
I am able to compile the project in VS in the pipeline
However, when I try to NuGet pack the same project that is used in the Restore Step above, I get this error:
##[error]The nuget command failed with exit code(1) and error(Error NU5012: Unable to find 'Newtonsoft.Json.13.0.1.nupkg'. Make sure the project has been built.
I have tried various combinations of Destination Directors on the Restore and Base Path in the Pack but still get that error or this one:
##[error]The NuGet command failed with exit code(1) and error(Cannot determine the packages folder to restore NuGet packages. Please specify either -PackagesDirectory or -SolutionDirectory.
I cannot find any documentation that explains how to do this.
How does one build this type of Pipeline?
Thanks for your help!
Updated:
this is the example i used when i receive the error
Apparently the package was installed from NuGet.org:
Installed Newtonsoft.Json 13.0.1 from https://api.nuget.org/v3/index.json with content hash ppPFpBcvxdsfUonNcvI etc.
Adding package 'Newtonsoft.Json.13.0.1' to folder 'D:...$(Build.ArtifactStagingDirectory )'
PackageSignatureVerificationLog: PackageIdentity: System.Runtime.4.3.1 Source: https://api.nuget.org/v3/index.json PackageSignatureValidity: True
Added package 'Newtonsoft.Json.13.0.1' to folder 'D:...$(Build.ArtifactStagingDirectory )'
Added package 'Newtonsoft.Json.13.0.1' to folder 'D:...$(Build.ArtifactStagingDirectory )' from source 'https://api.nuget.org/v3/index.json'
But I get this error on the Pack:
C:\hostedtoolcache\windows\NuGet\5.9.1\x64\nuget.exe pack D:\MyApp.Applications.Framework.Json.Converters.csproj -NonInteractive -OutputDirectory D:\a\1\a -BasePath D:\a\1\a -Properties "Configuration=Release" -IncludeReferencedProjects -version 2022.05.24.1 -Verbosity Detailed
Error NU5012: Unable to find 'Newtonsoft.Json.13.0.1.nupkg'. Make sure the project has been built.
Further Update:
I seem to be able to restore the NewtonSoft package:
PackageSignatureVerificationLog: PackageIdentity: Newtonsoft.Json.13.0.1 Source: https://api.nuget.org/v3/index.json PackageSignatureValidity: True
Installed Newtonsoft.Json 13.0.1 from https://api.nuget.org/v3/index.json with content hash ##
Adding package 'Newtonsoft.Json.13.0.1' to folder 'D:\a\1\s\XM\packages'
Added package 'Newtonsoft.Json.13.0.1' to folder 'D:\a\1\s\XM\packages'
Added package 'Newtonsoft.Json.13.0.1' to folder 'D:\a\1\s\XM\packages' from source 'https://api.nuget.org/v3/index.json'
Restoring NuGet package System.Net.Http.4.3.4.
However, the NuGet Pack step cannot find it:
Attempting to pack file: D:\a\1\s\XM\Applications\Framework\Json\Converters\XM.Applications.Framework.Json.Converters\XM.Applications.Framework.Json.Converters.csproj
C:\hostedtoolcache\windows\NuGet\5.9.1\x64\nuget.exe pack D:\a\1\s\XM\Applications\Framework\Json\Converters\XM.Applications.Framework.Json.Converters\XM.Applications.Framework.Json.Converters.csproj -NonInteractive -OutputDirectory D:\a\1\a -Properties Configuration=Release -IncludeReferencedProjects -version 2022.05.24.14 -Verbosity Detailed
Error NU5012: Unable to find 'Newtonsoft.Json.13.0.1.nupkg'. Make sure the project has been built.
Seems that the pack step doesn't see the nupkg. How can i tell the pack step where to find it?
[1]: https://i.stack.imgur.com/ME7M6.png

NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)

In my build pipeline, I have the following step:
I am getting the following error:
##[error]The nuget command failed with exit code(1) and error(NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)
When I go to the NuGet page for this package: Microsoft.Windows.SDK.BuildTools, I see that it only has one version: 10.0.18362.3-preview. I am not sure why the NuGet restore step is trying to get a higher version that does not exist. Why is this happening and how can I fix it? Note: this is my first Pipeline.
Agent Specification: Windows-2019.
From this page, you can see only two versions of the package Microsoft.Windows.SDK.BuildTools are listed:
10.0.19041.1
10.0.18362.3-preview
When open the page of version 10.0.19041.1, you can see the warning message to notify that this package version has been deprecated. But it seems that you can still download and install it.
I think the other package versions may have been permanently deleted by the owner due to some security vulnerabilities. So you no longer find them.
You can try to open your project using Visual Studio on your local machine, and change to use version 10.0.18362.3-preview in your program.

UmbracoCms installation error

I'm getting this error when I try to run the following line:
Install-Package UmbracoCms
And I'm getting this error:
Install-Package : An error occurred while downloading package 'Newtonsoft.Json.10.0.2 : ' from source 'https://www.nuget.org/api/v2/'
I have tried to do the following:
Install-Package Newtonsoft.Json -Version 10.0.2
And I still got this error:
Package 'Newtonsoft.Json.10.0.2 : ' does not exist in project 'Umbraco_MVC'
I also tried to delete the line with Newtonsoft in packages.config, but there is no line with that reference there
If I'm reading this correctly, and you're having an issue with getting JSON.NET installed through NuGet through both methods, then this (loosely related) GitHub issue thread might be of use to you.
https://github.com/google/google-api-dotnet-client/issues/1041
It involves changing the NuGet API URL you use to a newer version.
If your installation IS working, but you're still getting an issue, check your website bin folder to see if the dll is there. If not, check the References section of your web project to see if the dll is being referenced by your project.

CakeBuild: Get failed to install tool 'NUnit.ConsoleRunner'

I used CakeBuild to build and test my Xamarin Portable Class Library.
In the build.cake script I defined that I want to use the NUnit-Console to run my testcases. So I do
#tool nuget:?package=NUnit.ConsoleRunner
Unfortunatelly I get the following error when I run the Cake script.
Preparing to run build script...
VERBOSE: Restoring tools from NuGet...
VERBOSE: Feeds used:
C:\Users\bergkar\.nuget\packages\
All packages listed in C:\dev\Xamarin\fleetboard-core-library\tools\packages.config are already installed.
Running build script...
Analyzing build script...
Processing build script...
Installing tools...
Unable to find package 'NUnit.ConsoleRunner'
NuGet exited with 1
Could not find any relevant files for tool 'NUnit.ConsoleRunner'. Perhaps you need an include parameter?
Error: Failed to install tool 'NUnit.ConsoleRunner'.
When I add a specific version I want to use like below then everything works fine.
#tool nuget:?package=NUnit.ConsoleRunner&version=3.7.0
Can someone tell me why it is not working without the version stuff?
With ".\build.ps1 -Verbosity Diagnostic" I get the following output:
Preparing to run build script...
Running build script...
Module directory does not exist.
Analyzing build script...
Analyzing C:/dev/Xamarin/fleetboard-core-library/build.cake...
Processing build script...
Installing tools...
Installing NuGet package NUnit.ConsoleRunner...
Executing: "C:/dev/Xamarin/fleetboard-core-library/tools/nuget.exe" install "NUnit.ConsoleRunner" -OutputDirectory "C:/d
ev/Xamarin/fleetboard-core-library/tools" -ExcludeVersion -NonInteractive
Unable to find package 'NUnit.ConsoleRunner'
NuGet exited with 1
Feeds used:
Output:
Feeds used:
Could not find any relevant files for tool 'NUnit.ConsoleRunner'. Perhaps you need an include parameter?
Error: Cake.Core.CakeException: Failed to install tool 'NUnit.ConsoleRunner'.
at Cake.Core.Scripting.ScriptProcessor.InstallTools(ScriptAnalyzerResult analyzerResult, DirectoryPath installPath)
at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
at Cake.Commands.BuildCommand.Execute(CakeOptions options)
at Cake.CakeApplication.Run(CakeOptions options)
at Cake.Program.Main()
Now I found my problem and solved it.
The problem was that the NuGet.exe did not has a source feed which points to a public nuget source like "https://api.nuget.org/v3/index.json".
This was because my default NuGet.conf in under "C:\Users\YOUR_USER_HOME\AppData\Roaming\NuGet" had no packageSource defined. So Nuget just knows the local nuget package cache under "C:\Users\YOUR_USER_HOME.nuget\packages" and this did not include the specified package.
So after I added a packageSource in "C:\Users\YOUR_USER_HOME\AppData\Roaming\NuGet\NuGet.Conf" everything works fine.
Another way can be to add a new NuGet.Conf beside your build.ps1 file which contains all package sources you need for CakeBuild and your Xamarin project.
The following page explains how Nuget finds its configuration. Maybe this is helpful to understand the mechanism NuGet uses to find its configuration:
https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior

NuGet restore during first asp.net vNext project

Today I installed ASP.NET 5 on windows and begun creating my first application in Visual Studio 2015.
When the project loads I get an error: "Package restore failed", specifically the following error:
Restore failed Det gick inte att hitta en del av s�kv�gen C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512. NuGet Config files used:
C:\Users\h\AppData\Roaming\NuGet\nuget.config
C:\Users\h\documents\visual studio 2015\Projects\NextTest\nuget.config
Feeds used:
https://api.nuget.org/v3-flatcontainer/
C:\Program Files (x86)\Microsoft Web Tools\DNU
When I look for the missing file I find the following path missing:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512
But this one exists, note the extra 0 in the version:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0.0\Microsoft.Win32.Primitives.4.0.0.0.nupkg.sha512
How would I go about to solve this?
I've tried to search through the project files but no mention of neither Primitives nor verion 4.0.0.
The "Solution DNX SDK version" is 1.0.0-beta8, (beta5 was also available but not selected).
Delete C:\Users\h.dnx\packages folder and try running "dnu restore" command.