最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin6浏览0评论

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.
发布评论

评论列表(0)

  1. 暂无评论