更新生成控制器/代理建立C#6 /.NET 4.6应用程序 [英] Update Build Controller/Agents to build C# 6 /.NET 4.6 application

查看:270
本文介绍了更新生成控制器/代理建立C#6 /.NET 4.6应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里的情景:



我们使用Visual Studio Online和我们公司的网络TFS 2013的内部部署构建服务器建立门控入住手续后,我们的解决方案和释放。



现在我们从Visual Studio 2013升级到Visual Studio 2015年企业又迈上了新的.NET版本。我们真的渴望利用的C#6的新功能,而是先办理入住手续后,我们经历了构建失败。



(对不起,这里没有图片,因为我有一个缺乏信誉的)




异常消息:的MSBuild错误1结束此版本。你可以找到
有关此错误上面
消息的原因的更多具体信息。 (类型BuildProcessTerminateException)异常堆栈跟踪:在
System.Activities.Statements.Throw.Execute(CodeActivityContext
上下文)在
System.Activities.CodeActivity.InternalExecute(ActivityInstance
实例ActivityExecutor执行人,bookmarkManager bookmarkManager)
。在
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
执行人,bookmarkManager bookmarkManager,位置resultLocation)
ApplicationManager.cs(33, 0)意外字符$
ApplicationManager.cs(33,0);预计




似乎生成代理不理解新的语法与旧版本仍然编译。



我做什么,以解决这个问题是:





这基本上是安装Visual Studio 2015年和新的Microsoft生成工具




  • 而在这里这是非常有前途的:



我创建了一个新的构建定义与通过Web Access中创建一个新的代理池的模板



一为Visual Studio在线。下载



ConfigureAgent.ps1并执行它构建服务器上创建一个新的



代理上。但我无法弄清楚如何充分利用新建立的代理



我的问题是:我如何更新生成代理无故障在

对于新的.NET版本?


解决方案

我怀疑你'重新运行2013生成代理还是?在这种情况下,打开您的构建过程模板,并期待运行的MSBuild项目的任务。设置在安装href=\"https://msdn.microsoft.com/en-us/library/gg265783(v=vs.100).aspx\">刀具路径财产所在地的V14的MSBuild的

<预类=郎无prettyprint-覆盖> C:\Program文件(x86)\MSBuild\14.0\宾

这应允许您使用C#6语法元素。



从这个帖子的步骤中,包的NuGet不再现在需要的Visual Studio的2015 RTM。同样的包不再支持VS2013。



在下载谈不上TFS 2013年,同样没有一个TFS 2015年XAML生成代理新的TFS 2015年生成代理。 。只要你的服务器运行的TFS 2013年,您正在使用TFS建设2010最高至2013卡住



当连接到的VSO能够使用新的2015年生成代理。但是,你需要创建使用Web接口的新版本的定义。您不能使用新生成代理的exuiting XAML构建定义。



您还可以安装TFS 2015年XAML剂。要安装它构建服务器上安装TFS 2015年只能运行步骤来配置构建XAML代理的。这会从您的计算机中删除TFS 2013生成服务器。


here's the scene:

We use Visual Studio Online and an on-premise build server in our company network with TFS 2013 to build our solution after gated check-ins and releases.

Now we upgraded from Visual Studio 2013 to Visual Studio 2015 Enterprise and upgraded to the new .NET version. We are were really eager to make use of the new features of C# 6 but after the first check-in we experienced that the build failed.

(Sorry no image here as I have a lack of reputation)

Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) ApplicationManager.cs (33, 0) Unexpected character '$' ApplicationManager.cs (33, 0) ; expected

It seems that the build agent does not understand the new syntax and still compiles with old version.

What I did in order to fix it was:

  • Install Visual Studio 2015 on the on-premise build server (the older version Visual Studio 2013 is still installed)

  • Restarted the build controller

  • Followed the steps in here: http://stackoverflow.com/a/28327275/4919063

Which is basically installing Visual Studio 2015 and the new Microsoft Build Tools

  • And the steps in here which were very promising:

I created a new build definition with one of the templates

Created a new agent pool via the web access for Visual Studio Online. Downloaded

the ConfigureAgent.ps1 and executed it on the build server to create a new

agent. But I couldn't figure out how to make use of the newly created agent.

My question is: How can I update the build agents to run without failure in

respect to the new .NET version?

解决方案

I suspect that you're running the 2013 Build agent still? In that case, open your build process template and look up the "Run Msbuild for project" task. Set the ToolPath property to the location where your v14 MsBuild is installed. Default:

C:\Program Files (x86)\MSBuild\14.0\Bin

That should allow you to use the C# 6 syntax elements.

Remove the steps from this post by removing the Roslyn nuget packages, the NuGet package is no longer needed now that Visual Studio 2015 is RTM. The same package is no longer supported for VS2013.

The new TFS 2015 build agent you downloaded doesn't talk to TFS 2013, neither does a TFS 2015 XAML build agent. As long as your server is running TFS 2013, you're stuck using TFS Build 2010 up to and including 2013.

When connecting to VSO you should be able to use the new 2015 build agent. But you need to create a new build definition using the Web interface. You cannot use your exuiting XAML build definition with the new build agent.

You can also install the TFS 2015 XAML agent. To install it install TFS 2015 on the build server and only run the steps to configure the XAML build agent. This will remove the TFS 2013 build server from your machine.

这篇关于更新生成控制器/代理建立C#6 /.NET 4.6应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆