ReSharper 2026.3 Help

ASP.NET 中的代码检查

在 ASP.NET 中,ReSharper 2026.3 提供了两种代码检查:6 项 检测错误的检查 ,例如语法错误、未解析的符号、编译器错误等(这些检查无法配置或禁用),以及 39 项 专有代码检查 ,您可以 禁用或更改其 严重性级别。
These code inspections help you detect code issues at design time in all open files, and additionally they allow you to find code issues in specific scope.

可配置的 ASP.NET 检查列在下方,并按其 类别分组。

常见实践和代码改进(1 项检查)

此类别分组的检查主要查找中等严重性的问题,这些问题主要影响代码的可读性。

检查
ID
EditorConfig 属性

默认严重性

带有可选值问题的属性
Asp.TagAttributeWithOptionalValue
resharper_asp_tag_attribute_with_optional_value_highlighting

警告

语法问题(4 项检查)

此类别中的检查报告字符串字面量和文档注释中的 语法问题。

检查
ID
EditorConfig 属性

默认严重性

注释中的语法错误
GrammarMistakeInComment
resharper_grammar_mistake_in_comment_highlighting

建议

标记属性值中的语法错误
GrammarMistakeInMarkupAttribute
resharper_grammar_mistake_in_markup_attribute_highlighting

建议

标记文本中的语法错误
GrammarMistakeInMarkupText
resharper_grammar_mistake_in_markup_text_highlighting

建议

字符串字面量中的语法错误
GrammarMistakeInStringLiteral
resharper_grammar_mistake_in_string_literal_highlighting

已禁用

潜在的代码质量问题(25 项检查)

此类别包括检测关键问题(代码异味)的检查,主要具有 错误 或 警告 级别。 此类别还包括 确保本地化支持的检查。

检查
ID
EditorConfig 属性

默认严重性

ASP.NET 无效代码
Asp.DeadCode
resharper_asp_dead_code_highlighting

警告

ASP.NET 解析警告
Asp.ResolveWarning
resharper_asp_resolve_warning_highlighting

警告

ASP.NET 警告
Asp.Warning
resharper_asp_warning_highlighting

警告

无法解析属性
PropertyNotResolved
resharper_property_not_resolved_highlighting

错误

无法解析资源
ResourceNotResolved
resharper_resource_not_resolved_highlighting

错误

无法解析资源项
ResourceItemNotResolved
resharper_resource_item_not_resolved_highlighting

错误

无效的控件类型
Asp.InvalidControlType
resharper_asp_invalid_control_type_highlighting

错误

MVC(模型类型不匹配)
Mvc.InvalidModelType
resharper_mvc_invalid_model_type_highlighting

错误

MVC(未知操作)
Mvc.ActionNotResolved
resharper_mvc_action_not_resolved_highlighting

错误

MVC(未知区域)
Mvc.AreaNotResolved
resharper_mvc_area_not_resolved_highlighting

错误

MVC(未知控制器)
Mvc.ControllerNotResolved
resharper_mvc_controller_not_resolved_highlighting

错误

MVC(未知母版页)
Mvc.MasterpageNotResolved
resharper_mvc_masterpage_not_resolved_highlighting

错误

MVC(未知部分视图)
Mvc.PartialViewNotResolved
resharper_mvc_partial_view_not_resolved_highlighting

错误

MVC(未知模板)
Mvc.TemplateNotResolved
resharper_mvc_template_not_resolved_highlighting

错误

MVC(未知视图组件视图)
Mvc.ViewComponentViewNotResolved
resharper_mvc_view_component_view_not_resolved_highlighting

错误

MVC(未知视图组件)
Mvc.ViewComponentNotResolved
resharper_mvc_view_component_not_resolved_highlighting

错误

MVC(未知视图)
Mvc.ViewNotResolved
resharper_mvc_view_not_resolved_highlighting

错误

未访问的字段(非私有可访问性)
NotAccessedField.Global
resharper_not_accessed_field_global_highlighting

建议

对象数据源方法解析问题
AspOdsMethodReferenceResolveError
resharper_asp_ods_method_reference_resolve_error_highlighting

错误

未知内容占位符
Asp.ContentPlaceholderNotResolved
resharper_asp_content_placeholder_not_resolved_highlighting

错误

未知皮肤
Asp.SkinNotResolved
resharper_asp_skin_not_resolved_highlighting

错误

未知符号
Asp.NotResolved
resharper_asp_not_resolved_highlighting

错误

未知主题
Asp.ThemeNotResolved
resharper_asp_theme_not_resolved_highlighting

错误

不支持的 pageParserFilterType
Asp.CustomPageParserFilterType
resharper_asp_custom_page_parser_filter_type_highlighting

警告

错误的图像大小
Asp.Image
resharper_asp_image_highlighting

警告

代码中的冗余(3 项检查)

此类别中的代码检查会查找冗余和无用代码,这些代码会影响代码的可读性和风格,并且可以安全地移除。 某些代码冗余无法自动修复,其快速修复需要在交互模式下完成,需用户输入。 但大多数冗余可以在无需用户交互的情况下修复,使用 范围内修复 或 代码清理。

检查
ID
EditorConfig 属性

默认严重性

冗余的 using 指令
RedundantUsingDirective
resharper_redundant_using_directive_highlighting

警告

未使用的导入子句
UnusedImportClause
resharper_unused_import_clause_highlighting

警告

未使用的注册指令
AspUnusedRegisterDirectiveHighlighting
resharper_asp_unused_register_directive_highlighting_highlighting

警告

符号声明中的冗余(1 项检查)

此类别包括代码检查,主要为 警告严重性级别,用于检测空的和未使用的符号声明。

检查
ID
EditorConfig 属性

默认严重性

类型成员从未使用(非私有可访问性)
UnusedMember.Global
resharper_unused_member_global_highlighting

建议

拼写问题(5 项检查)

这些检查 检测各种上下文中的拼写错误。

检查
ID
EditorConfig 属性

默认严重性

注释中的拼写错误
CommentTypo
resharper_comment_typo_highlighting

建议

标识符中的拼写错误
IdentifierTypo
resharper_identifier_typo_highlighting

建议

标记属性值中的拼写错误
MarkupAttributeTypo
resharper_markup_attribute_typo_highlighting

建议

标记文本中的拼写错误
MarkupTextTypo
resharper_markup_text_typo_highlighting

建议

字符串字面量中的拼写错误
StringLiteralTypo
resharper_string_literal_typo_highlighting

建议

2026年 11月 6日