Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

tfsbuild - TFS 2013 building .NET 4.6 / C# 6.0

We use TFS 2013 to as our build server. I've started a C# 6.0 project and I am trying to get it to build. I am using the new null-conditional operators, and my build chokes. I've tried installing several things on the TFS server, including the targeting pack and VS 2015. I've tried providing /tv:14.0 to the MSBuild arguments.

ConfigurationEntityEntityConfig.cs (270): Invalid expression term '.'
ConfigurationEntityEntityConfig.cs (283): Invalid expression term '.'
ConfigurationEntityEntityConfig.cs (283): Syntax error, ':' expected
... etc.

At this point, I have no idea what else to try. Any suggestions would be greatly appreciated.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

People using TFS 2012 have reported success using:

/tv:14.0 /p:GenerateBuildInfoConfigFile=false /p:VisualStudioVersion=14.0

as arguments to MSBuild. Perhaps this might work for you, but so far this does not work for my TFS 2013 build agents.

Update: I finally got this to work on TFS 2013. Here is what I had to do:

  1. Install VS 2015 or Microsoft Build Tools 2015 (I have both).
  2. Edit my build to use a build process template called TfvcTemplate.12.xaml. I guess that any template newer than this one will do, but the DefaultTemplate.11.1.xaml definitely won't work!)
  3. Set MSBuild arguments to /tv:14.0 I did not have to use the other two I mentioned above.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...