dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
502 stars 193 forks source link

Code Analysis to validate views in ASP.NET #4290

Open mikadumont opened 3 years ago

mikadumont commented 3 years ago

Direct customer ask copying here:

ReShaper for example offers additions errors and hints / code analytics. One of those validates the views in ASP.NET. If you try to return a view that does not exist (see sample), ReSharper adds red squiggles, and you get an additional error. With vanilla VS20xx there is not hint at all.

image

You just don't get a hint that e.g. a cshtml file, doesn't exist. This should be a compile error, but it is now just a runtime error.

With ReSharper the line is marked as error and its red:

image

ShreyasJejurkar commented 3 years ago

When I started working on ASP.NET MVC back in 2015 in college, I always wondered about this ReSharper feature about detecting views and how intelligently it does!

I hope this will be an official, built-in feature with SDK going forward! 🤞