ReSharper 2026.3 Help

路由模板中的代码检查

在路由模板中,ReSharper 2026.3 提供了 17 项 专有代码检查 ,您可以 禁用其中的任何一项或更改其 严重性级别。
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.

可配置的路由模板检查列在下方,并按其 类别分组。

代码通知(17 项检查)

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

检查
ID
EditorConfig 属性

默认严重性

操作的路由前缀可以提取到控制器的路由中
RouteTemplates.ActionRoutePrefixCanBeExtractedToControllerRoute
resharper_route_templates_action_route_prefix_can_be_extracted_to_controller_route_highlighting

提示

控制器的路由参数可以传递给方法
RouteTemplates.ControllerRouteParameterIsNotPassedToMethods
resharper_route_templates_controller_route_parameter_is_not_passed_to_methods_highlighting

提示

未找到匹配的参数约束构造函数
RouteTemplates.MatchingConstraintConstructorNotResolved
resharper_route_templates_matching_constraint_constructor_not_resolved_highlighting

警告

匹配了多个参数约束构造函数
RouteTemplates.AmbiguousMatchingConstraintConstructor
resharper_route_templates_ambiguous_matching_constraint_constructor_highlighting

警告

并非所有路由参数都传递给了方法
RouteTemplates.MethodMissingRouteParameters
resharper_route_templates_method_missing_route_parameters_highlighting

提示

可选参数在段中只能以单个句点('.')为前缀
RouteTemplates.OptionalParameterCanBePrecededOnlyBySinglePeriod
resharper_route_templates_optional_parameter_can_be_preceded_only_by_single_period_highlighting

警告

可选参数必须位于段的末尾
RouteTemplates.OptionalParameterMustBeAtTheEndOfSegment
resharper_route_templates_optional_parameter_must_be_at_the_end_of_segment_highlighting

警告

路由中声明的参数重复
RouteTemplates.DuplicatedParameter
resharper_route_templates_duplicated_parameter_highlighting

警告

由于应用的约束,参数的类型可以更严格
RouteTemplates.ParameterTypeCanBeMadeStricter
resharper_route_templates_parameter_type_can_be_made_stricter_highlighting

建议

路由参数可以传递给方法
RouteTemplates.RouteParameterIsNotPassedToMethod
resharper_route_templates_route_parameter_is_not_passed_to_method_highlighting

提示

路由参数约束参数无法转换为目标类型
RouteTemplates.ConstraintArgumentCannotBeConverted
resharper_route_templates_constraint_argument_cannot_be_converted_highlighting

警告

可以根据方法参数的类型添加路由参数约束
RouteTemplates.ParameterConstraintCanBeSpecified
resharper_route_templates_parameter_constraint_can_be_specified_highlighting

提示

路由参数约束未解析
RouteTemplates.RouteParameterConstraintNotResolved
resharper_route_templates_route_parameter_constraint_not_resolved_highlighting

警告

路由标记未解析
RouteTemplates.RouteTokenNotResolved
resharper_route_templates_route_token_not_resolved_highlighting

警告

符号未解析
RouteTemplates.SymbolNotResolved
resharper_route_templates_symbol_not_resolved_highlighting

警告

语法错误
RouteTemplates.SyntaxError
resharper_route_templates_syntax_error_highlighting

警告

参数的类型不满足路由模板中声明的约束
RouteTemplates.ParameterTypeAndConstraintsMismatch
resharper_route_templates_parameter_type_and_constraints_mismatch_highlighting

警告

2026年 11月 6日