1

I have created a project in Visual studio 2017. It builds perfectly locally, but when trying to build using VSTS build agent, its giving below warning -

[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.

and after that getting below error -

    [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]

target framework is 4.7 , and using nuget restore version 4.4.1 in build task.

Please suggest some solution, I checked multiple blog but did not get help.

Edit 1 - build definition screen shot

Nabin Jha
  • 11
  • 3
  • Do you use `Hosted VS2017` agent queue? Is assembly `StackExchange.Redis, Version=1.2.6.0` defined in the `packages.config` file? Could you share a screenshot of your build definition? – Cece Dong - MSFT Jul 20 '18 at 06:17
  • Yes I have used Hosted VS2017 agent queue and Redis assembly is defined in package.config. – Nabin Jha Jul 20 '18 at 09:59
  • Could you please try have a fresh copy of your source (without package) locally, and restore the package from nuget 4.4.1, to check what result will you get? – Cece Dong - MSFT Jul 23 '18 at 10:10
  • Can you share the detail log on OneDrive? On the other hand, can you reproduce this issue with a new project? – starian chen-MSFT Jul 24 '18 at 10:39

0 Answers0