ReSharper 2025.2 Help

Web.config 中的代码检查

在 Web.config 中,ReSharper 2025.2 提供了 13 项 专有代码检查 ,您可以 禁用其中的任何一项或更改其 严重性级别
这些 代码检查帮助您在所有打开的文件中 设计时检测代码问题,并且还允许您 在特定范围内查找代码问题

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

代码通知(2 项检查)

此类别分组了严重性级别较低的代码检查。

检查
ID
EditorConfig 属性

默认严重性

忽略的路径
Web.IgnoredPath
resharper_web_ignored_path_highlighting

已禁用

映射路径
Web.MappedPath
resharper_web_mapped_path_highlighting

提示

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

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

检查
ID
EditorConfig 属性

默认严重性

无法解析模块
WebConfig.ModuleNotResolved
resharper_web_config_module_not_resolved_highlighting

错误

无法解析符号
WebConfig.TypeNotResolved
resharper_web_config_type_not_resolved_highlighting

错误

需要模块限定
WebConfig.ModuleQualificationResolve
resharper_web_config_module_qualification_resolve_highlighting

警告

在网站中找不到引用的路径
WebConfig.WebConfigPathWarning
resharper_web_config_web_config_path_warning_highlighting

警告

错误的模块
WebConfig.WrongModule
resharper_web_config_wrong_module_highlighting

错误

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

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

检查
ID
EditorConfig 属性

默认严重性

冗余的 add 元素
WebConfig.UnusedAddTag
resharper_web_config_unused_add_tag_highlighting

警告

冗余的 add namespace 元素
WebConfig.RedundantAddNamespaceTag
resharper_web_config_redundant_add_namespace_tag_highlighting

警告

由于 'configSource' 属性导致的冗余元素或属性
WebConfig.UnusedElementDueToConfigSourceAttribute
resharper_web_config_unused_element_due_to_config_source_attribute_highlighting

警告

冗余的 location 元素
WebConfig.RedundantLocationTag
resharper_web_config_redundant_location_tag_highlighting

警告

冗余的 remove 或 clear 元素
WebConfig.UnusedRemoveOrClearTag
resharper_web_config_unused_remove_or_clear_tag_highlighting

警告

冗余的 tagPrefix 声明
WebConfig.TagPrefixRedundand
resharper_web_config_tag_prefix_redundand_highlighting

警告

最后修改日期: 2025年 9月 27日