Update runtime compilation to target CSharpLang v8.0 by default (#13110)
Fixes https://github.com/aspnet/AspNetCore/issues/9129
This commit is contained in:
parent
417cba2d50
commit
b2a0b02e35
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue