0

I'm aware of the MvcBuildViews option but it doesn't with my project (one error not related to my view leads to another and after several hours and errors later I'm done with it, it just won't work for us). There has to be a simpler way to check for compiler errors in my views, I don't want to run IIS, I don't want to publish or deploy, idc about virtual or physical paths, I just want compile time safety for my ugh... compiled resources. How can I see just the compiler errors generated by my views without a ton of stupid overhead that my very large, cumbersome, years old project isn't configured for?

tereško
  • 58,060
  • 25
  • 98
  • 150
evanmcdonnal
  • 46,131
  • 16
  • 104
  • 115
  • 1
    Can you show some code to give an example of a compile-time error that you think should be caught but isn't? Views can be tricky, but it's even trickier to try to help you solve your problem without any more context than you're giving. – Brian Driscoll Aug 20 '15 at 17:55
  • By the way, AFAIK MvcBuildViews is the only way I know how to do compile-time checking of your views. – Brian Driscoll Aug 20 '15 at 18:01
  • @BrianDriscoll as an example, we had a lot of views with something like; `@{ ViewBag.Title = @Resources.Language.ThisPagesTitleString; }` which worked in razor 1.0 but in 2.0 cause a compiler error. The error states there is an extra closing brace in the file, the solution is to remove the @ from `@Resources.Language.ThisPagesTitleString`. That is the most wide spread problem but there were a couple others, a similar one with generics where the type argument was being interpreted as an html tag, stuff like that. – evanmcdonnal Aug 24 '15 at 21:30

0 Answers0