2017-09-07 1 views
0

asp.netコアソリューションでvs2017を使用して、2つのローカルアセンブリがnugetを介して参照されています(DLLがパックされています)。今、私は解決策のルートにある.nugetフォルダ内のnuget.configファイルを持って、私は次のエラーを取得していますVSTS経由でビルドを生成するチームサービスビルドで失敗したナゲットリストア

<?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>  

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はステップ

build definition

を復元し、デフ構築VSTSには何かということです

これは、ローカルのアセンブリを参照しているようで、標準のnuget.orgではなく、設定ファイルにあります。フレームワークアセンブリへのローカルエントリを取り出すと、Nugetパートは動作しますが、私はローカルに梱包されている2つのアセンブリを見つける。

この時点で、これで円を描いていますが、どのようにVSTSにnuget.orgだけでなくローカルのパックされたアセンブリを復元させることができますか?私はHosted 2017も使用しています。

ありがとうございました

+0

パッケージはビルドサーバ*の 'D:\ TestFrameworkAssemblies' *にありますか? –

+0

オンラインでVSTSを使用してビルドを行うと、ホストされたエージェント上のファイルシステムにアクセスできますか? –

答えて

1

Hostedエージェントでビルドをキューに入れていたようです。ローカルマシンにパッケージがあるので、ローカルマシンにあるprivate agentをビルドする必要があります。

さらに、Hostedエージェントでビルドをキューに入れる必要がある場合は、ローカルパッケージをリポジトリに追加してから、新しいパスでパッケージを参照し、値をnuget.configに変更する必要があります。

+0

だから私はVSTSで開催されている私のソリューションにパッケージを追加する必要があります。あなたには例がありますか?私のソリューションではすでにローカルパスを参照していますが、このソリューションでVSTS CI/CDをセットアップしようとすると、開発中の標準である2つのローカルアセンブリを参照しようとしているので、もっと複雑です。 –

+0

VSTS経由でプライベートエージェントを使ってどのように構築しますか? –

+0

最初にプライベートエージェントを設定する必要があります。詳しくはhttps://www.visualstudio.com/en-us/docs/build/actions/agents/v2-windowsを参照してください。 –

関連する問題