在VSTS构建代理中构建解决方案时出现错误CS0246

时间:2018-07-19 10:55:24

标签: c# msbuild azure-pipelines azure-pipelines-build-task .net-4.7

我已经在Visual Studio 2017中创建了一个项目。它在本地完美构建,但是当尝试使用VSTS构建代理进行构建时,其警告如下-

[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "StackExchange.Redis, Version=1.2.6.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

然后出现错误-

    [error]..\Utils\RedisService.cs(4,7): Error CS0246: The type or namespace name 'StackExchange' could not be found (are you missing a using directive or an assembly reference?) 
2018-07-18T13:03:08.3934570Z Utils\RedisService.cs(4,7): error CS0246: The type or namespace name 'StackExchange' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\myProject.csproj]
2018-07-18T13:03:08.3938262Z ##[error]..\Utils\RedisService.cs(18,16): Error CS0246: The type or namespace name 'IDatabase' could not be found (are you missing a using directive or an assembly reference?)
2018-07-18T13:03:08.3939130Z Utils\RedisService.cs(18,16): error CS0246: The type or namespace name 'IDatabase' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\myProject.csproj]

目标框架是4.7,并在构建任务中使用nuget restore版本4.4.1。

请提出一些解决方案,我检查了多个博客,但没有得到帮助。

编辑1- build definition screen shot

0 个答案:

没有答案