Visual studio 2017 团队服务生成中的nuget还原失败

Visual studio 2017 团队服务生成中的nuget还原失败,visual-studio-2017,azure-pipelines,nuget-package-restore,Visual Studio 2017,Azure Pipelines,Nuget Package Restore,我在asp.net核心解决方案上使用vs2017通过nuget(打包dll)引用了2个本地程序集,在本地构建良好 现在尝试通过VSTS生成构建时,我得到以下错误: Detected NuGet version 4.0.0.2283 / 4.0.0 SYSTEMVSSCONNECTION exists true Saving NuGet.config to a temporary config file. d:\a\_tool\NuGet\4.0.0\x64\nuget.exe restore d

我在asp.net核心解决方案上使用vs2017通过nuget(打包dll)引用了2个本地程序集,在本地构建良好

现在尝试通过VSTS生成构建时,我得到以下错误:

Detected NuGet version 4.0.0.2283 / 4.0.0
SYSTEMVSSCONNECTION exists true
Saving NuGet.config to a temporary config file.
d:\a\_tool\NuGet\4.0.0\x64\nuget.exe restore d:\a\1\s\TestFrameworkCoreAPI.sln -Verbosity Detailed -NonInteractive -ConfigFile d:\a\1\Nuget\tempNuGet_37.config
NuGet Version: 4.0.0.2283
MSBuild auto-detection: using msbuild version '15.3.409.57025' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
MSBuild P2P timeout [ms]: 120000
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe /t:GenerateRestoreGraphFile /nologo /nr:false /p:RestoreUseCustomAfterTargets=true /p:BuildProjectReferences=false /v:q  /p:NuGetRestoreTargets="d:\a\_temp\NuGet-Scratch\w53qa5rr.4sd.targets" /p:RestoreTaskAssemblyFile="d:\a\_tool\NuGet\4.0.0\x64\nuget.exe" /p:RestoreGraphOutputPath="d:\a\_temp\NuGet-Scratch\4mlmlfgh.mmy.result" /p:ExcludeRestorePackageImports=true  /p:RestoreRecursive=False  /p:RestoreProjectFilterMode=exclusionlist /p:RestoreContinueOnError=WarnAndContinue  /p:RestoreGraphProjectInput="d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj;" "d:\a\_temp\NuGet-Scratch\w53qa5rr.4sd.targets"
Running restore with 2 concurrent jobs.
Reading project file d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj.
Reading project file d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj.
Restoring packages for d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj...
Restoring packages for d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj...
Restoring packages for .NETCoreApp,Version=v1.1...
Restoring packages for .NETCoreApp,Version=v2.0...
System.AggregateException: One or more errors occurred. ---> NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'Microsoft.VisualStudio.Web.CodeGeneration.Tools' from remote source 'D:\TestFrameworkAssemblies'.
   at NuGet.Protocol.LocalV3FindPackageByIdResource.GetVersionsCore(String id, ILogger logger)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at NuGet.Protocol.LocalV3FindPackageByIdResource.GetAllVersionsAsync(String id, SourceCacheContext cacheContext, ILogger logger, CancellationToken token)
   at NuGet.Commands.SourceRepositoryDependencyProvider.<FindLibraryAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
Error: d:\a\_tool\NuGet\4.0.0\x64\nuget.exe failed with return code: 1
Packages failed to restore
检测到NuGet版本4.0.0.2283/4.0.0
SYSTEMVSSCONNECTION存在true
正在将NuGet.config保存到临时配置文件。
d:\a\\U tool\NuGet\4.0.0\x64\NuGet.exe还原d:\a\1\s\TestFrameworkCoreAPI.sln-详细详细信息-非交互式-配置文件d:\a\1\NuGet\tempNuGet\U 37.config
NuGet版本:4.0.0.2283
MSBuild自动检测:使用“C:\Program Files(x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin”中的MSBuild版本“15.3.409.57025”。使用选项-MSBuildVersion强制nuget使用特定版本的MSBuild。
MSBuild P2P超时[ms]:120000
C:\Program Files(x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\MSBuild.exe/t:GenerateRestoreGraphFile/nologo/nr:false/p:RestoreUstomAfterTargets=true/p:BuildProjectReferences=false/v:q/p:NuGetRestoreTargets=“d:\a\\临时\NuGet Scratch\w53qa5rr.4sd.targets”/p:RestoreTaskAssemblyFile=“d:\a\\工具\NuGet\4.0.0\x64\NuGet.exe”/p:RestoreGraphOutputPath=“d:\a\\u temp\NuGet Scratch\4mllfgh.mmy.result”/p:ExcludeRestorePackageImports=true/p:RestoreCursive=False/p:RestoreProjectFilterMode=ExcludeList/p:RestoreContinueOnError=WarnAndContinue/p:RestoreGraphProjectInput=“d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj;”“d:\a\\u temp\NuGet Scratch\w53qa5rr.4sd.targets”
使用2个并发作业运行还原。
正在读取项目文件d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj。
正在读取项目文件d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj。
正在还原d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj的包。。。
正在还原d:\a\1\s\TestFrameworkCoreAPI\TestFrameworkCoreAPI.csproj的包。。。
正在还原.NETCoreApp的包,版本=v1.1。。。
正在还原.NETCoreApp的包,版本=v2.0。。。
System.AggregateException:发生一个或多个错误。-->NuGet.Protocol.Core.Types.FatalProtocolException:未能从远程源“D:\TestFrameworkAssembly”检索有关“Microsoft.VisualStudio.Web.CodeGeneration.Tools”的信息。
位于NuGet.Protocol.LocalV3FindPackageByIdResource.GetVersionsCore(字符串id,ILogger记录器)
位于System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey,Func`2 valueFactory)
在NuGet.Protocol.LocalV3FindPackageByIdResource.getAllVersionAsync(字符串id、SourceCacheContext、cacheContext、ILogger记录器、CancellationToken令牌)
在NuGet.Commands.sourcerepositorydependencProvider.d_u12.MoveNext()中
---来自引发异常的上一个位置的堆栈结束跟踪---
错误:d:\a\\ U tool\NuGet\4.0.0\x64\NuGet.exe失败,返回代码:1
无法还原程序包
我在解决方案根目录下的.nuget文件夹中有一个nuget.config文件

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
  <!-- remove any machine-wide sources with <clear/> -->
  <clear />
  <add key="Test Framework" value="D:\TestFrameworkAssemblies" />
  <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<activePackageSource>
    <add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>     

看起来它总是引用我的本地程序集,而不是标准的nuget.org,现在在配置文件中,如果我取出框架程序集的本地条目,nuget部分工作,但我得到一个主要引用错误,因为它找不到我在本地打包的2个程序集

目前,我们正在讨论如何让VST从nuget.org恢复本地打包的程序集。我也在使用Hosted 2017


提前感谢

您似乎正在对托管代理上的生成进行排队。由于包位于您的本地计算机上,您应该使用位于您的本地计算机上的进行生成


另外,如果需要在托管代理上对生成进行排队,则应在存储库中添加本地包,然后使用新路径引用这些包,并在
numget.config

中更改值。这些包是否位于生成服务器上的
D:\TestFrameworkAssemblies
中?使用VST进行生成时,是否可以如此联机访问托管代理上的文件系统?因此,我必须将包添加到我在VSTS中保存的解决方案中,然后以某种方式引用?您是否有一个示例。在我的解决方案中,我已经引用了本地路径,但试图在此解决方案上设置VSTS CI/CD,似乎要复杂得多,因为我所做的只是尝试引用2个本地汇编ies,这将是开发中的标准。如何通过VSTS使用专用代理进行构建?您需要首先设置专用代理,详细步骤如下。我们取得了进展:-),完成了构建代理,现在nuget恢复正常,因此将设置您的答复作为答案。但在构建解决方案时,会出现另一个错误“TransformWebConfig”“无法从程序集C:\Program Files\dotnet\sdk\1.1.0\sdk\Microsoft.NET.sdk.Publish\build\netstandard1.0\..\tools\net46\\Microsoft.NET.sdk.Publish.Tasks.dll加载任务。无法加载文件或程序集的file:///C:\Program Files\dotnet\sdk\1.1.0\sdk\Microsoft.NET.sdk.Publish\tools\net46\Microsoft.NET.sdk.Publish.Tasks.dll'或其依赖项之一。确认声明正确,程序集及其所有依赖项可用,并且该任务包含一个实现Microsoft.Build.Framework.ITask的公共类。