.net - How to continue views compilation after first error in Visual Studio - Stack Overflow

I'm working on aproject with lots of razor views (.cshtml), and after upgrading a dependency i w

I'm working on a project with lots of razor views (.cshtml), and after upgrading a dependency i will need to fix lots of errors.

Is there a way to prevent the compiler to not stop at the first error and instead make it so it compiles every view in the project, listing all the existing errors like it does in Jet Brains Rider?

Currently using Visual Studio 2022.

I'm working on a project with lots of razor views (.cshtml), and after upgrading a dependency i will need to fix lots of errors.

Is there a way to prevent the compiler to not stop at the first error and instead make it so it compiles every view in the project, listing all the existing errors like it does in Jet Brains Rider?

Currently using Visual Studio 2022.

Share Improve this question asked Nov 18, 2024 at 11:23 Leonardo T.Leonardo T. 9910 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Even when you can get a compile & link tool such as Visual Studio to carry on despite errors you run the risk of cascade errors that make it problematic to locate the actual source of the error due to the sheer volume of problem reports.

If you are looking for something to go through your code looking for potential problems and to list them all out for you then you will probably be better off running a linter. The trick of course is to find a linter that supports razor views (.cshtml) as well as your code.

  • ReSharper will highlight & list potential problems from within your IDE for you. This is probably one of your best options.
  • Some editions of SonarCube do support this.
  • OmiSharp may have implemented this support by now.
  • There may well be others.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745621889a4636568.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信