Description
Using Utf8 string literals in a razor page trigger
RZ1000
Unterminated string literal. Strings that start with a quotation mark (") must be terminated before the end of the line. However, strings that start with @ and a quotation mark (@") can span multiple lines.
PR that introduced this (?): #11086
Repro
Create a ASP.NET Core Web App (Razor Pages) project and add the following code to Index.cshtml:
@page
@using System.Text
@model IndexModel
<div class="text-center">
@{
ReadOnlySpan<byte> span = "hello"u8; // <- here's the error location
}
<p>@Encoding.UTF8.GetString(span)</p>
</div>
(yeah I know it's nonsense, but stripped down from a real project were Utf8 literals makes sense).
Expected behavior
Utf8 string literals are supported and don't trigger RZ1000.
Workaround
Update csproj with
<PropertyGroup>
<NoWarn>$(NoWarn);RZ1000</NoWarn>
</PropertyGroup>
Description
Using Utf8 string literals in a razor page trigger
PR that introduced this (?): #11086
Repro
Create a ASP.NET Core Web App (Razor Pages) project and add the following code to
Index.cshtml:(yeah I know it's nonsense, but stripped down from a real project were Utf8 literals makes sense).
Expected behavior
Utf8 string literals are supported and don't trigger RZ1000.
Workaround
Update
csprojwith