• Post Calendar

    January 2011
    S M T W T F S
    « Dec   Feb »
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  

Migrated to Razor View Engine for MVC 3

I just finished converting my views from .aspx files to .cshtml Razor view engine files. It took about 4 hours for 38 views. The key lesson I learned is, “If you didn’t do anything very fancy in a View, just delete it and recreate it.” I think that would have caused it to go faster. That time also included the time required to understand the whole model and some of the syntax. Phil Haack has a great post titled, “Razor Syntax Quick Reference” that helped with the migration.

It is a pretty nice an concise approach. My son was working with the Music Store sample site this afternoon and was very impressed with how much you can do with so little code.

I still need to do some more testing. Of all the code on the site, it’s all these views that lack any for of automated testing. The only way I can think of to test all that is using Coded UI tests. Since the site is small right now, I’ll probably just test each page once for the moment. I hope to push that version of the site up next weekend.

I’m looking forward to working with the Razor view engine going forward.

Leave a Comment