为什么R#警告我CSHTML中有一行注释掉了



R#在注释掉的行上告诉我"Possible‘System.NullReferenceException’":

// report_params = { GUID: @Model.GUID, SerialNumber: @Model.SerialNumber, ReportName: @Model.ReportName }; 

灯泡"代理"具有"检查模型是否为空"one_answers"断言模型不为空"选项

为什么Resharper检查注释掉的代码?然而,以下实时代码却毫发无损:

report_params =
{
    GUID: "@Model.GUID",
    SerialNumber: "@Model.SerialNumber",
    ReportName: "@Model.ReportName"
};

尽管这些vals的引号在我看来是错误的。

更新

R#还告诉我,这行HTML:的"未知css类'staticLabel'"

<label for="BeginDate" class="staticLabel">Begin Date</label>

当我在相同的.cs.html文件中,在部分

.staticLabel {
    display: inline-block;
    width: 140px;
    margin-right: 2px;
    text-align: right;
    font-family: Consolas, Candara, sans-serif;
    font-weight: bold; 
    color: brown;
}

(这并不是在抱怨其他课程被认为是未知的)

更新2

我有一个"无与伦比的结束标签"(是重复的,在486行隐藏着流氓rapscalion)。

在ASP.NET MVC剃刀视图中,注释标记为@*code*@。//没有评论剃刀里的行。

最新更新