哪个设置告诉 Resharper(带有 StyleCop)不要在一行上对齐 ASP.Net 控制器属性?
Which setting tells Resharper (with StyleCop) to not align ASP.Net controller attributes on one line?
示例代码:
[AllowAnonymous] [HttpPost("Register")] public async Task<IActionResult> Register(RegisterParameters parameters)
它应该是什么样子:
[AllowAnonymous]
[HttpPost("Register")]
public async Task<IActionResult> Register(RegisterParameters parameters)
哪个设置告诉 Resharper(带有 StyleCop)不要在一行上对齐 ASP.Net 控制器属性,而是在多行上对齐?我还没找到设置。
叫做"Place method attribute on the same line"。但它只有在您关闭另一个名为 "Keep existing arrangement of attributes" 的设置时才有效。
Dmitry Osinovskiy 回答的补充信息:
- "Place method attribute on the same line" 可以在 "C#" 下找到 → "Formatting Style" → "Line Breaks and Wrapping" → "Arrangement of Attributes" 需要设置为"Never":
- "Keep existing arrangement of attributes" 可以在 "C#" 下找到 → "Formatting Style" → "Line Breaks and Wrapping" → "Arrangement of Attributes" 需要设置为"Off"(无勾选):
示例代码:
[AllowAnonymous] [HttpPost("Register")] public async Task<IActionResult> Register(RegisterParameters parameters)
它应该是什么样子:
[AllowAnonymous]
[HttpPost("Register")]
public async Task<IActionResult> Register(RegisterParameters parameters)
哪个设置告诉 Resharper(带有 StyleCop)不要在一行上对齐 ASP.Net 控制器属性,而是在多行上对齐?我还没找到设置。
叫做"Place method attribute on the same line"。但它只有在您关闭另一个名为 "Keep existing arrangement of attributes" 的设置时才有效。
Dmitry Osinovskiy 回答的补充信息:
- "Place method attribute on the same line" 可以在 "C#" 下找到 → "Formatting Style" → "Line Breaks and Wrapping" → "Arrangement of Attributes" 需要设置为"Never":
- "Keep existing arrangement of attributes" 可以在 "C#" 下找到 → "Formatting Style" → "Line Breaks and Wrapping" → "Arrangement of Attributes" 需要设置为"Off"(无勾选):