My company has TFS 2013.
I have a project using C# 6.0 features.
My team does not have direct access to the build server. VS2015 is not yet installed there but the folks that manage the server are looking to install the 2015 build tools.
In the mean time I have installed the Microsoft.Net.Compilers NuGet package as mentioned in answers to C# 6.0 TFS Builds and several other questions here.
Some projects in the solution already had it installed: (an Asp.Net MVC 5 project and a Web API project.)
When the solution is built, TFS uses the Rosyln compiler from the package for some projects and the default compiler for others.
- I've removed and re-added the package.
- I've tried switching between version 1.0.0, 1.1.0, and 1.3.2 of the package.
- I've opened the .csproj files side by side to look for subtle differences.
- I've created multiple solutions and multiple build definitions out of the same projects to see if some combination was causing the problem.
- One of the projects always builds with the default compiler when part of one build and with the Roslyn compiler when build as part of another.
The two web projects never use the Roslyn compiler. There are 3 other libraries, one console application, and a hand-full of projects containing unit/integration tests. With the exception of the one project (one of the libraries) that behaves differently depending on which build it is in, all of the projects seem consistent in which compiler they use
What am I missing here? Why might TFS use the package compiler for some projects but not for others?
Sampling of build errors: Use of nameof:
SomeController.cs (53): The name 'nameof' does not exist in the current context
a static using:
RedactedTests.cs (5): Identifier expected; 'static' is a keyword
RedactedTests.cs (5): Expected class, delegate, enum, interface, or struct
null coalescing operator:
InterestingClassName.cs (40): Invalid expression term '.'
InterestingClassName.cs (40): Syntax error, ':' expected
InterestingClassName.cs (40): Invalid expression term '.'
InterestingClassName.cs (40): Syntax error, ':' expected
expression bodied property:
MyClass.cs (11): ; expected
MyClass.cs (11): Method must have a return type
MyClass.cs (11): Type expected