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