I have a C# Razor page that ReSharper (via TeamCity Professional 2019.1.3, so likely 2019.1.1) is flagging as having Potential Code Quality Issues > Not closed tag.
Since I'm only using the version of ReSharper that comes with TeamCity I need to manually add the code to ignore this error.
According to the ReSharper documentation for Potential Code Quality issues the ID is Html.TagNotClosed
, which means that I should be able to use the following comment above the code that's triggering this error: ReSharper disable once Html.TagNotClosed
However, if I try either of the following code snippets ReSharper does not ignore this error.
@if (currentRecord % 3 == 1)
{
// ReSharper disable once Html.TagNotClosed
<text><div class="row top-spacing-none bottom-spacing-small" data-equalizer="" data-equalizer-mq="medium-up"></text>
}
// alternative
@if (currentRecord % 3 == 1)
{
<!-- ReSharper disable once Html.TagNotClosed -->
<text><div class="row top-spacing-none bottom-spacing-small" data-equalizer="" data-equalizer-mq="medium-up"></text>
}
I've confirmed that this is the line it's throwing an error on, and this is the code I want to try, due to the issue covered by Razor doesn't understand unclosed html tags.
What's the proper way to have ReSharper ignore a 'Not closed tag' error in a Razor CSHTML file?