【发布时间】:2020-06-04 04:24:44
【问题描述】:
首先,我有一个 NuGet.Config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value=".\ExternalReferences\Packages" />
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</config>
</configuration>
在我的dev 分支的根目录中。我的工作是,我的dev 分支中的每个项目都将包恢复到\dev\ExternalReferences\Packages,这在本地运行良好。
我正在尝试通过 TFS (VisualStudio Team Services/DevOps) 为我的 CI-Build 引入 Azure Pipelines。
但是,TFS 将包恢复到错误的文件夹 \dev\packages(其中 \dev 是 D:\a\9\s\)而不是 \dev\ExternalReferences\Packages。
Acquired lock for the installation of Newtonsoft.Json 12.0.3
Installing Newtonsoft.Json 12.0.3.
Adding package 'Microsoft.Extensions.Logging.Abstractions.2.2.0' to folder 'D:\a\9\s\packages'
这会在稍后破坏构建(需要ExternalReferences\Packages):
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
ResolveAssemblyReferences:
Primary reference "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL".
##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [D:\a\9\s\Conwell.WebServices.Google\Conwell.WebServices.Google.csproj]
知道如何让 NuGet 恢复到正确的目录吗?
我刚刚为项目类型 Asp.NET 创建了一个标准管道
【问题讨论】:
标签: c# tfs azure-devops continuous-integration nuget