# Web:UnclosedTagCheck being thrown in Razor C# Code when using generics

**URL:** <https://community.sonarsource.com/t/web-unclosedtagcheck-being-thrown-in-razor-c-code-when-using-generics/29413>\
**Category:** Report False-positive / False-negative...\
**Tags:** razor, html\
**Created:** [August 11, 2020, 5:32pm UTC](https://community.sonarsource.com/t/web-unclosedtagcheck-being-thrown-in-razor-c-code-when-using-generics/29413 "2020-08-11T17:32:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shieldsjared](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/shieldsjared/32/14708_2.png) [@shieldsjared](https://community.sonarsource.com/u/shieldsjared)\
**Post date:** [August 11, 2020, 5:32pm UTC](https://community.sonarsource.com/t/web-unclosedtagcheck-being-thrown-in-razor-c-code-when-using-generics/29413/1 "2020-08-11T17:32:31Z")

</div>

False positive generated while using SQ 8.4 (and default packaged plugins).

Sample code: `myfile.cshtml`

```auto
@model List<MyObject>

```

This is valid razor syntax, and throws false-positive **Web:UnclosedTagCheck** , stating “The tag MyObject has no corresponding closing tag.”. This is valid razor syntax.

---

<div class="post-metadata">

**Author:** ![Nils\_Werner](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nils_werner/32/14437_2.png) [@Nils\_Werner](https://community.sonarsource.com/u/Nils_Werner)\
**Post date:** [October 26, 2020, 3:54pm UTC](https://community.sonarsource.com/t/web-unclosedtagcheck-being-thrown-in-razor-c-code-when-using-generics/29413/3 "2020-10-26T15:54:50Z")

</div>

Hello @shieldsjared,

sorry for the late response to your request. Unfortunately, this is a known problem, which has already been reported in this [thread](https://community.sonarsource.com/t/false-positive-with-rule-all-html-tags-should-be-closed-on-cshtml/21411). We have created a [ticket](https://jira.sonarsource.com/browse/SONARHTML-119) for it, which will probably be fixed during the next maintenance of the HTML analyzer.  
Until then you can add your objects to the “_ignoreTags_” property of the rule, so it is not too noisy.

Cheers,  
Nils

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [April 8, 2021, 8:53am UTC](https://community.sonarsource.com/t/web-unclosedtagcheck-being-thrown-in-razor-c-code-when-using-generics/29413/4 "2021-04-08T08:53:55Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
