Saturday, September 13, 2008

ASP.NET MVC Build Errors in Views

I have been using the ASP.NET MVC since preview 3 and I ran across something very strange today. I had a few errors in lambda expressions in my view for Html.ActionLink(...). I thought that when I built my project these would be caught and the build would fail.

Well, its not happening for me. If the views aren't getting compiled then the whole SCHWEET reason to have strongly typed stuff in there kinda goes out the window!

Am I missing something? Can other people reproduce this problem? Isn't it intended to fail on the build if there are errors in the view?

3 comments:

Anonymous said...

If you add a web deployment project and then build that it will catch (most?) compile time errors on builds.

Tommy said...

I don't know, but I shouldn't have to add a deployment project to catch build errors in my project (at least I think that makes sense). I mean I could just use strings and it wouldn't work either, but the whole reason to use the strongly typed stuff is so you 'catch errors at build time not run time'.

I guess I should post this in the forums and see if its a bug / not implemented yet.

Anonymous said...

I've been using ASP.Net since the first betas and I don't think I've ever seen it pick up compile errors inside of aspx pages.

Just by browsing with IIS or doing a web deployment project. I'd love to be proven wrong!

Resharper is useful for picking them up though. Nice product.