Update runtime compilation to target CSharpLang v8.0 by default (#13110)

Fixes https://github.com/aspnet/AspNetCore/issues/9129
This commit is contained in:
Pranav K 2019-08-15 09:18:41 -07:00 committed by GitHub
parent 417cba2d50
commit b2a0b02e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -211,10 +211,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
if (string.IsNullOrEmpty(dependencyContextOptions.LanguageVersion))
{
// During preview releases, Roslyn assumes Preview language version for netcoreapp3.0 targeting projects.
// We will match the behavior if the project does not specify a value for C# language (e.g. if you're using Razor compilation in a F# project).
// Prior to 3.0 RTM, this value needs to be changed to "Latest". This is tracked via https://github.com/aspnet/AspNetCore/issues/9129
parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.Preview);
// If the user does not specify a LanguageVersion, assume CSharp 8.0. This matches the language version Razor 3.0 targets by default.
parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp8);
}
else if (LanguageVersionFacts.TryParse(dependencyContextOptions.LanguageVersion, out var languageVersion))
{