Skip to content

Commit b2a0b02

Browse files
authored
Update runtime compilation to target CSharpLang v8.0 by default (#13110)
Fixes #9129
1 parent 417cba2 commit b2a0b02

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Mvc/Mvc.Razor.RuntimeCompilation/src/CSharpCompiler.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ private static CSharpParseOptions GetParseOptions(
211211

212212
if (string.IsNullOrEmpty(dependencyContextOptions.LanguageVersion))
213213
{
214-
// During preview releases, Roslyn assumes Preview language version for netcoreapp3.0 targeting projects.
215-
// 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).
216-
// Prior to 3.0 RTM, this value needs to be changed to "Latest". This is tracked via https://github.com/aspnet/AspNetCore/issues/9129
217-
parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.Preview);
214+
// If the user does not specify a LanguageVersion, assume CSharp 8.0. This matches the language version Razor 3.0 targets by default.
215+
parseOptions = parseOptions.WithLanguageVersion(LanguageVersion.CSharp8);
218216
}
219217
else if (LanguageVersionFacts.TryParse(dependencyContextOptions.LanguageVersion, out var languageVersion))
220218
{

0 commit comments

Comments
 (0)