在 Razor 中禁用 Visual Studio 代码格式 [英] Disable Visual Studio code formatting in Razor

查看:31
本文介绍了在 Razor 中禁用 Visual Studio 代码格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之前有人问过这个问题:为什么对于 Razor 标记,Visual Studio 代码格式不能正常工作吗?

This has been asked before: Why doesn't Visual Studio code formatting work properly for Razor markup?

但是这个问题已经有几年了.而且 Razor 格式仍然完全不可接受.我已经放弃修复它了.

But that question is a couple years old. And Razor formatting is still completely unacceptable. I have given up on fixing it.

我可以禁用 CSHTML 文件的所有 Visual Studio 格式吗?如果没有,我可以完全禁用所有 Visual Studio 格式吗?我可以使用任何 3rd 方黑客吗?一定有事!

Can I disable ALL Visual Studio formatting for CSHTML files? If not, can I disable all Visual Studio formatting entirely? Any 3rd party hacks I can use? There's got to be something!

我已升级到 2013 年,但格式同样糟糕.

I've upgraded to 2013 and the formatting is just as bad.

:2015 年也太糟糕了.我真的希望他们能解决这个问题.

: 2015 is god-awful as well. I REALLY wish they would fix this.

:2017 年也太糟糕了.我真的希望他们能解决这个问题.

: 2017 is god-awful as well. I REALLY wish they would fix this.

:2019 年也太糟糕了.我真的希望他们能解决这个问题.也就是说,微软发布了一个新的格式化引擎 仅适用于 .Net Core.

: 2019 is god-awful as well. I REALLY wish they would fix this. That said, Microsoft released a new formatting engine for .Net Core only.

推荐答案

你不能.自第一个 .net 版本(visual studio 2002/2003)以来,这是 VS 的功能"内置的.

You cannot. This is built in "feature" of VS since the first .net version (visual studio 2002/2003).

有大量关于格式错误的连接报告,但微软完全忽略了它们,或者将修复程序推送到下一个版本".您可以在 此处.

There are tons of connect report about the formatting bugs, but Microsoft ignores them completly, or pushing the fix to the "next version". You can see an example Microsoft answer here.

您可以在此处

这篇关于在 Razor 中禁用 Visual Studio 代码格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆