ASP.NET MVC 3 Strongly-typed Views: Why do compiler errors disappear/are ignored when a view is not open in VS editor?

StackOverflow https://stackoverflow.com/questions/16923415

문제

Every time we make changes to a model we need to open all views using that model in VS editor and see if there are any errors before proceeding with a new deployment. Is there a way to enforce compiler errors in a strongly-typed view and prevent a project build so that no embarrassing errors ever appear on runtime? :-)

Thanks!

도움이 되었습니까?

해결책

You can compile cshtml and aspx files at build time instead of runtime. To do this unload project, open it for edit, find <MvcBuildViews> tag and change value to true. If you have edmx files in your project clean solution before first edit.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top