VSTO + Nuget secure Feeds #3346
Replies: 2 comments
-
Just encountered that problem aswell. The solution seems to be to omit the MSBuildVersion in the NugetRestoreSettings. Also using a recent version of nuget(v4.1++) helps |
Beta Was this translation helpful? Give feedback.
-
Just looking back at this issue and I resolved this with the following change. |
Beta Was this translation helpful? Give feedback.
-
What You Are Seeing?
Unable to configure Cake + VSTO VS2017 agents to correct restore nuget packages + use secure nuget feeds hosted in VSTO.
What is Expected?
An easy and secure way of using Cake with Nuget Credential providers and the choice of user/password or API keys with out storing those secrets in the cake.build program.
What version of Cake are you using?
0.21.1.0
Are you running on a 32 or 64 bit system?
64
What environment are you running on? Windows? Linux? Mac?
Windows and Windows Server
Are you running on a CI Server? If so, which one?
VSTO online + VS2017 agent.
How Did You Get This To Happen? (Steps to Reproduce)
Created a Cake.build file and created basic build steps from a VS2017 solution.
Ran the process successfully on local developer workstation.
Created a VSTO nuget feed.
Added VSTO nuget feed security.
Downloaded CredentialProvider.VSS.exe and placed in build directory. Configured VSTO credentials (prompted for personal user/password credentials for my MSDN VSTO account).
Moved 'secure' internal *.nugkg packages to VSTO secure repository.
Confirmed local workstation correctly downloads nuget packages from the secure VSTO nuget feed.
Confirmed powershell .\build.ps1 would execute cake.build on local workstation.
Created 2 VSTO builds.
First build definition used VSTO the services 'nuget package' restore task to confirm the package security applied. (you don't get prompted for credentials).
Second build definition uses Cake.build triggered from .\build.ps1.
Tried a range of options around nuget + cake + vsto secure nuget feeds. Each attempt seems to throw different roadblocks, making cake + VSTO nuget feeds less desirable technology choice.
Output Log
NuGet-Configured
Executing task: NuGet-Configured
NugetDir: D:\a\1\s\tools\nuget.exe
Nuget Source Missing MyVIP-Internal-NugetRepo: https://FakeCustomer.pkgs.visualstudio.com/_packaging/MyVIP-Internal-NugetRepo/nuget/v2
Package Source with Name: MyVIP-Internal-NugetRepo added successfully.
Nuget Source Exists - MyVIP-Internal-NugetRepo: https://FakeCustomer.pkgs.visualstudio.com/_packaging/MyVIP-Internal-NugetRepo/nuget/v2
Finished executing task: NuGet-Configured
Restore-NuGet-Packages
Executing task: Restore-NuGet-Packages
NuGet Version: 4.1.0.2450
System.AggregateException: One or more errors occurred. ---> NuGet.CommandLine.CommandLineException: Cannot find the specified version of msbuild: '15'
Process completed with exit code 1 and had 1 error(s) written to the error stream.
at NuGet.CommandLine.MsBuildUtility.GetToolsetFromUserVersion(String userVersion, IEnumerable
1 installedToolsets) at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectoryInternal(String userVersion, IConsole console, IEnumerable
1 installedToolsets, Func1 getMsBuildPathInPathVar) at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectory(String userVersion, IConsole console) at System.Lazy
1.CreateValue()at System.Lazy
1.LazyInitValue() at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs) at NuGet.CommandLine.RestoreCommand.<DetermineRestoreInputsAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.CommandLine.RestoreCommand.<ExecuteCommandAsync>d__30.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at NuGet.CommandLine.Command.Execute() at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args) ---> (Inner Exception #0) NuGet.CommandLine.CommandLineException: Cannot find the specified version of msbuild: '15' at NuGet.CommandLine.MsBuildUtility.GetToolsetFromUserVersion(String userVersion, IEnumerable
1 installedToolsets)at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectoryInternal(String userVersion, IConsole console, IEnumerable
1 installedToolsets, Func
1 getMsBuildPathInPathVar)at NuGet.CommandLine.MsBuildUtility.GetMsBuildDirectory(String userVersion, IConsole console)
at System.Lazy
1.CreateValue() at System.Lazy
1.LazyInitValue()at NuGet.CommandLine.RestoreCommand.ProcessSolutionFile(String solutionFileFullPath, PackageRestoreInputs restoreInputs)
at NuGet.CommandLine.RestoreCommand.d__37.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.RestoreCommand.d__30.MoveNext()<---
An error occurred when executing task 'Restore-NuGet-Packages'.
Error: NuGet: Process returned an error (exit code 1).
Beta Was this translation helpful? Give feedback.
All reactions