简体   繁体   English

在Visual Studio中更新Nuget包后无法生成内部版本的定义

[英]Build Definition Not Building After Nuget package Update In Visual Studio

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. 基本上,我们使用TFS 2015 ,因为我们有一个通过远程计算机上的代理的构建定义(我可以远程访问),因此,一名开发人员使用更新的NuGet包( Newtonsoft.Json )和它破坏了构建。 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. 我有一个截图imgur的一点背景知识在我的构建定义和webhook我们用来在农闲链接的通知发送到一个错误页面,告诉我"error: Build Not Found"让我各种困惑和我在网上找不到任何可以帮助我的东西。

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?) 编辑:在我的构建日志中,我收到此错误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. 我所有其他分支的构建工作均正常进行,唯一的区别是我更新了nuget软件包。 Is there any way for me to upgrade the nuget package in the build agent? 有什么办法可以升级构建代理中的nuget软件包?

Screenshot of Build Definition: 构建定义的屏幕截图:

图片取自https://imgur.com/vziGUmZ

Build Definition Not Building After Nuget package Update In Visual Studio 在Visual Studio中更新Nuget包后无法生成内部版本的定义

AFAIK, the reason of this issue may be that you upgraded the package Newtonsoft.Json to version 9.01 or higher. AFAIK,此问题的原因可能是您将软件包Newtonsoft.Json升级到了9.01版或更高版本。

Starting from Newtonsoft.Json 9.0.1 , this package supports the targets framework .NETStandard : Newtonsoft.Json 9.0.1开始,此软件包支持目标框架.NETStandard

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

在此处输入图片说明

Which is supported by NuGet 2.12 for Visual Studio 2013 : NuGet 2.12Visual Studio 2013提供支持

NuGet 2.12 Release Notes NuGet 2.12发行说明

  • Full NetStandard and NetCoreApp support for VS2013. 对VS2013的完整NetStandard和NetCoreApp支持。

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. 因此,要解决此问题,您应确保nuget.exe版本高于2.12 ,Visual Studio版本高于2013。

Besides, as we know, Visual Studio are backwards compatible. 此外,众所周知,Visual Studio向后兼容。 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. 意味着我们可以使用较低版本的Visual Studio开发项目,也可以在代理上使用较高版本的Visual Studio进行构建。 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. 因此,如果我们认为代理上的Visual Studio版本高于您正在开发的版本,那会更好。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM