Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Umbrella] Improving compiler adoption and dogfooding story #18783
See the various sections below for adopting new versions of the compiler (including nightlies) in various contexts (VS, ASP.NET, etc). This is still work-in-progress.
As we shift to point release model, it is increasingly important that we make it easy for customers (external and internal to Microsoft) to adopt new versions of the compiler, including previews.
Then there's also internal adoption and dogfooding: building VS code itself, building corefx, building corefxlab, dogfooding with .NET Native, etc
There is also the
referenced this issue
Apr 18, 2017
Consuming C# compiler from CoreXT
Note: this doesn't work with
(Thanks Zack Runner for the instructions and package)
Dogfooding Roslyn on VS 2017
Important note: there is a known issue with un-installing this. Use at your own perils. We are working towards a solution.
To get back to a clean state:
referenced this issue
May 12, 2017
My list of contacts:
Consuming C# compiler from ASP.NET
A number of people on stackoverflow are reporting trouble adopting C# 7.0 in their ASP.NET and ASP.NET Core projects. This often has strange symptoms, where the IDE accepts the new syntax (no squiggles), but building the solution or F5 produce errors in the Output window.
This is caused by a mismatch between the built-in compiler (used by VS) and the compiler pulled in as a nuget package by ASP.NET projects. The
To troubleshoot this, open the "Manage NuGet packages" UI, then select the "Browse" tab. Search for "Microsoft.Net.Compilers" and look at the installed version and the newest available version.
The fix for ASP.NET:
The fix for ASP.NET Core 1.0:
services.AddMvc().AddRazorOptions(options => options.ParseOptions = new CSharpParseOptions(LanguageVersion.CSharp7));
For ASP.NET Core 2.0, there should be no need to set Razor options. It uses the language version from the project (the Razor views and the code-behind use the same language version). This works with "default" and "latest", but there is a parsing bug with handling "7.1" (tracking issue).
Note: if you want to use C# 7.0 tuples in your project, you'll also need to install
Where to find
Consuming C# compiler from CLI
As far as I can tell, upgrading the