I am getting this annoying error when trying to use a simple interpolated string in my cshtml
file:
@for (int i = 0; i < ppTitles.Count; i++)
{
<p>@ResourceLibrary.Resources.GetString($"PP_Text_{i + 1}")</p>
}
Feature 'interpolated strings' is not available in C# 5. Please use language version 6 or greater.
I have tried all of the solutions here
- Got the langversion in
web.config
- Tried surrounding the string with
@()
- Upgraded the project to
4.5.2
and here
- Changed language version from
default
to6
- Installed CodeDome with
Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
I have used string interpolation in other areas of the project (in regular .cs
files) without any issue.
What is going on here?