0

I inherited a lot of stuff that is above my knowledge level, but I am the only one here that is close enough to that level to figure it out. I feel like I learn quickly, and I have been able to jump every hurdle so far without too much time taken, but I just can't figure this out!

Basically we use TFS 2015 and in that we have a build definition that goes through an agent on a remote computer (that I can remote into).So, one of the developers checked in code with an updated NuGet package (Newtonsoft.Json) and it broke the build. The files and everything build locally just fine, but the build bot is broken.

I have a screenshot on imgur for a little context in my build definition and the webhook we use to send the notification in slack links to a an error page that tells me "error: Build Not Found" so I am all kinds of confused and I can't find anything online that can help me.

EDIT: In my build logs I got this error Error CS0246: The type or namespace name 'DataSourceRequest' could not be found (are you missing a using directive or an assembly reference?)

All of my other branch builds work and the only difference is that I updated the nuget package. Is there any way for me to upgrade the nuget package in the build agent?

Screenshot of Build Definition:

image taken from https://imgur.com/vziGUmZ

  • 1
    The notification in slack "error: Build Not Found" is too simple. You should go to your build pipeline to check the details error log share it to us, otherwise, we could not get any useful info. Besides, you can try to rollback the package version to the old to confirm if this issue is caused by the nuget package update. – Leo Liu Jul 18 '19 at 06:16
  • Is it a VS 2017 project? Which version of nuget are you using on your build agent? – Setorica Jul 18 '19 at 09:20
  • 1
    So it turned out that I didn't have enough access before to see all of the errors and issues that the build itself was having. in the logs I found `##[warning]Visual Studio not found. Try installing a supported version of Visual Studio. See the task definition for a list of supported versions.` So, right now I am trying to install VS 2013 (which is what it used before but our license expired.) and update the license. I will edit this post if I can't figure it out from there. Thanks! – CaptainKirk Jul 18 '19 at 14:09
  • 1
    the build agent won't use anything newer than VS 2015, but I am using 2013 in the build agent. I use 2019 for production – CaptainKirk Jul 18 '19 at 18:25

1 Answers1

0

Build Definition Not Building After Nuget package Update In Visual Studio

AFAIK, the reason of this issue may be that you upgraded the package Newtonsoft.Json to version 9.01 or higher.

Starting from Newtonsoft.Json 9.0.1, this package supports the targets framework .NETStandard:

https://www.nuget.org/packages/Newtonsoft.Json/9.0.1:

enter image description here

Which is supported by NuGet 2.12 for Visual Studio 2013:

NuGet 2.12 Release Notes

  • Full NetStandard and NetCoreApp support for VS2013.

So, to resolve this issue, you should make sure the nuget.exe version is higher than 2.12 and the Visual Studio version is high than 2013.

Besides, as we know, Visual Studio are backwards compatible. Meaning we could use the lower version Visual Studio to develop the project and we could build it with a higher version of Visual Studio on the agent. But if the other way around, develop it with higher version, build it with lower version on the agent, we may encounter some issues due to compatibility. So, If we keep that the Visual Studio version on the agent is higher than the version you are developing, it would be better.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Okay, so I have VS 2019 installed and ready to use, but I don't know how to make the agent know to use that when I trigger a build. Is there a setting somewhere that I can change to affect that? – CaptainKirk Jul 22 '19 at 15:58
  • @KirkK, You can use MSBuild task and specify the MSBuild to the path of MSBuild 16.0, check this thread:https://stackoverflow.com/questions/56984966/team-foundation-server-2018-build-agent-capabilities-vs-2019 – Leo Liu Jul 23 '19 at 09:56