NuGet Installer with local nupkg
See original GitHub issueWhen trying to run the NuGet installer build task, I am running into an error listed below. I am assuming the error for relative URI is for the localRepository, but changing it to ../
does not work either. Inside of the web portal, I have “Path to Solution”, “Path to NuGet.config”, and “Disable local cache” filled out and enabled. Since the “Restore NuGet Packages” is depreciated, I want to implement the new task.
Set workingFolder to default: B:\tasks\NuGetInstaller\0.1.21
Executing the powershell script: B:\tasks\NuGetInstaller\0.1.21\NuGetInstaller.ps1
##[debug]Loading module from path 'B:\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Internal\Microsoft.TeamFoundation.DistributedTask.Task.Internal.dll'.
##[debug]Importing cmdlet 'Add-BuildAttachment'.
##[debug]Importing cmdlet 'Convert-String'.
##[debug]Importing cmdlet 'Get-IndexedSourceFilePaths'.
##[debug]Importing cmdlet 'Get-JavaDevelopmentKitPath'.
##[debug]Importing cmdlet 'Get-MSBuildLocation'.
##[debug]Importing cmdlet 'Get-ServiceEndpoint'.
##[debug]Importing cmdlet 'Get-TfsClientCredentials'.
##[debug]Importing cmdlet 'Get-ToolPath'.
##[debug]Importing cmdlet 'Get-TaskVariable'.
##[debug]Importing cmdlet 'Get-VisualStudioPath'.
##[debug]Importing cmdlet 'Get-VssConnection'.
##[debug]Importing cmdlet 'Invoke-Ant'.
##[debug]Importing cmdlet 'Invoke-BatchScript'.
##[debug]Importing cmdlet 'Invoke-Maven'.
##[debug]Importing cmdlet 'Invoke-MSBuild'.
##[debug]Importing cmdlet 'Invoke-PublishSymbols'.
##[debug]Importing cmdlet 'Invoke-Tool'.
##[debug]Importing cmdlet 'Invoke-VSTest'.
##[debug]Importing cmdlet 'Publish-BuildArtifact'.
##[debug]Importing cmdlet 'Copy-BuildArtifact'.
##[debug]Importing cmdlet 'Add-BuildArtifactLink'.
##[debug]Importing cmdlet 'Register-XamarinLicense'.
##[debug]Importing cmdlet 'Unregister-XamarinLicense'.
##[debug]Importing cmdlet 'Get-X509Certificate'.
##[debug]Loading module from path 'B:\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Common\Microsoft.TeamFoundation.DistributedTask.Task.Common.dll'.
##[debug]Importing cmdlet 'Complete-Task'.
##[debug]Importing cmdlet 'Get-LocalizedString'.
##[debug]Importing cmdlet 'Set-TaskVariable'.
##[debug]Importing cmdlet 'Set-TaskProgress'.
##[debug]Importing cmdlet 'Add-TaskIssue'.
##[debug]Importing cmdlet 'Write-TaskDetail'.
##[debug]Importing cmdlet 'Find-Files'.
##[debug]Entering script System.Management.Automation.InvocationInfo.MyCommand.Name
##[debug]Parameter Values
##[debug]solution = B:\Agent\_work\18\s\Automation\SOLUTIONNAME.sln
##[debug]nugetConfigPath = B:\Agent\_work\18\s\Automation\PROJECTNAME\nuget.config
##[debug]noCache = true
##[debug]nuGetRestoreArgs =
##[debug]nuGetPath =
##[debug]No Pattern found in solution parameter.
##[debug]Getting credentials for Microsoft.TeamFoundation.DistributedTask.Agent.Common.TaskEndpoint
##[debug]Adding credentials section to NuGet.config
##[error]System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
##[error] at CallSite.Target(Closure , CallSite , Object , String , String )
##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
##[error] at System.Management.Automation.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error]System.Management.Automation.MethodInvocationException: Exception calling "Create" with "1" argument(s): "This operation is not supported for a relative URI." ---> System.InvalidOperationException: This operation is not supported for a relative URI.
##[error] at System.Uri.get_AbsoluteUri()
##[error] at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
##[error] at CallSite.Target(Closure , CallSite , RuntimeType , Uri )
##[error] --- End of inner exception stack trace ---
##[error] at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
##[error] at CallSite.Target(Closure , CallSite , RuntimeType , Uri )
##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error]System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
##[error] at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
##[error] at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="localRepository" value="..\" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<packageRestore>
<!--Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
</packageRestore>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How do I install a NuGet package .nupkg file locally?
Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages". Select your new package source. Enter image description ...
Read more >Install and use a NuGet package in Visual Studio (Windows ...
Select Project > Manage NuGet Packages. · In the NuGet Package Manager page, choose nuget.org as the Package source. · From the Browse...
Read more >How to install NuGet Packages locally - DEV Community
How to install NuGet Packages locally ... If you are a NuGet package creator and want to test it before publish them, just...
Read more >Creating and Using a Local NuGet Package - Atomic Spin
Consuming the Local Feed · In the Tools menu, select Options . This will open up the options dialog box. · Find NuGet...
Read more >Working with NuGet Local Packages - CODE Magazine
From Visual Studio's menu, select Tools > Options, and then enter NuGet in the search input. Select the suitable Package Sources, as shown...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not 100% sure what you’re trying to do. Are you trying to have a persistent local cache of packages? Because if so, the hosted agent won’t help you – the VM gets recycled after each build run.
If you have private or additional packages you want to use with your build, you should use our package management features. I’m biased, of course, since that’s the part of the product I work on 😃 There’s a decent introduction to the feature in our documentation.
👍