2017-12-27 5 views
0

내 휴대용 C# 프로젝트를 .Net Standard 2.0으로 변환하는 데 문제가 있습니다..Net 표준을 로컬로 빌드하지만 팀 빌드를 사용하지 않습니다.

나는 Adam Pedley가 설명한 방법을 따라 Upgrade PCL to .NET Standard Class Library으로 갔고 결국 모든 작업이 로컬에서 처리되었습니다. 우리의 빌드 서버에 대기열 그러나, 나는 다음과 같은 오류에 직면하고있다 :

C:\Program Files\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(323,5): error : Assets file 'D:\Builds\Agent-57-01_work\11\s\MyProject\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [D:\Builds\Agent-57-01_work\11\s\MyProject\MyProject.csproj]

우리의 빌드 서버 에이전트 버전 2.120.2을 실행 및 Visual Studio 15.4.5이 있습니다. 설치.

+0

귀하의 빌드에 NuGet 복구가 포함되어 있거나 MSbuid 호출이 있습니까? '/ restore' 인자를 포함 시키시겠습니까? –

+0

@MartinUllrich 우리는 NuGet의 3.0.0 버전으로 NuGet Installer 태스크를 설정했습니다. 4.0.0으로 변경하면 문제가 해결되었습니다. –

답변

1

최신 NuGet (Nuget 버전 4.3.0)을 사용하여 패키지를 복원하십시오.

VSTS를 사용하는 경우 NuGet 도구 설치자을 사용하여 Nuget 버전 4.3.0을 설치할 수 있습니다. 온 프레미스 (on-premise), 바로 해결 아래의 사항을 지켜 TFS를 들어

: (. 자세한 내용은 Using the latest NuGet in your build 참조)

Because the NuGet Tool Installer is not available in TFS versions prior to TFS 2018, there is a recommended workaround to use versions of NuGet > 4.0.0 in Team Build.

  1. Add the task, if you haven’t already. If you have a “NuGet Restore” step in the catalog (it may be in the Deprecated tasks section), insert it into your build. Otherwise, insert a “NuGet” step.
  2. For your NuGet/NuGet Installer step, use the version selector under the task name to select version “0.*”.
  3. In the Advanced section, set the NuGet Version to “Custom” and the Path to NuGet.exe as $(Build.BinariesDirectory)\nuget.exe
  4. Before your NuGet step, add a “PowerShell” step, select “Inline Script” as the Type, enter this PowerShell script as the Inline Script, and enter “4.3.0” (or any version of NuGet from this list) as the Arguments.

는 또한 스레드 아래 참조 :

+0

@Tore Østergaard 문제를 해결 했습니까? 모든 업데이트? –

+0

빌드에서 NuGet의 3.3.0 버전으로 설정된 NuGet Installer 태스크가있었습니다. 4.0.0으로 변경하면 해당 빌드의 문제가 해결되었습니다. 현재 NuGet Installer 작업을 사용하지 않는 다른 빌드에서 유사한 문제를 조사하고 있습니다. –

관련 문제