VSTS Build-NUGET恢复错误:第一个标记之前为非空格 [英] VSTS Build - NUGET restore error: Non-whitespace before first tag
问题描述
我是VSTS的新手. 我想建立我的解决方案.由于某种原因,曾经存在的Visual Studio模板不再存在.因此,我使用ASP.Net模板. 目前,它在Nuget Restore上失败;
I am new to VSTS. I want to build my solution. For some reason the Visual Studio template that was once there is no longer. So I use the ASP.Net template. Currently it is failing on the Nuget Restore;
设置如下;
当我进入高级还原选项并选择V4而不是默认V3.3时,出现此错误;
When I go to the advanced restore options and choose V4 instead of the default V3.3, I get this error instead;
==============================================================================
Task : NuGet Installer
Description : Installs or restores missing NuGet packages
Version : 0.2.31
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
==============================================================================
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 4.0.0.2283 / 4.0.0
SYSTEMVSSCONNECTION exists true
d:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\4.0.0\NuGet.exe restore -NonInteractive d:\a\1\s\SIR.sln -ConfigFile d:\a\1\s\SIR.sln
NuGet.Config is not valid XML. Path: 'd:\a\1\s\SIR.sln'.
Data at the root level is invalid. Line 2, position 1.
Error: d:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\4.0.0\NuGet.exe failed with return code: 1
Packages failed to install
******************************************************************************
Finishing: NuGet restore
******************************************************************************
我该如何解决?
推荐答案
我认为这是VS 2017项目,请尝试使用Hosted VS 2017代理.
I assume it is a VS 2017 project, try to use Hosted VS 2017 agent instead.
更新:
隔离Nuget还原步骤/任务的Nuget 4.0版本:
Sepecify Nuget 4.0 version of Nuget restore step/task:
编辑-通过以下注释,通过将"Path to nugget.config"参数设置为空白,可以解决此问题
EDIT - From the comments below, the problem was fixed by making blank the "Path to nugget.config" parameter
这篇关于VSTS Build-NUGET恢复错误:第一个标记之前为非空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!