October 2008 Archives

I've been using ASP.NET MVC since preview 1, and have loved every bit of it.  Between preview releases, none of my code broke -- even between 2 and 3...  Wait that can't be right...

So when the MVC beta dropped recently, I went ahead and upgraded my three projects.  Little did I know that when I was upgrading all of those other times, I was forgetting to update my assembly references!  Big d'oh!  I had been using preview 2 this whole time!

Upgrading from preview 2 to the beta can be a bit of a pain, so here are some hints to make the process easier, if anyone out there actually needs to do this.

  • Update your strongly typed ViewData references to use ViewData.Model - This one is pretty self-explanitory.  If you have strongly typed ViewData (by typing ViewData<Foo> in your codebehind) you need to reference ViewData.Model in your views now.
  • ViewData is now ViewDataDictionary - If you have custom ViewData-derived classes, you should change them to inherit ViewDataDictionary.  I just got rid of mine completely and created some ViewInfo classes to pack up all the common data I needed to send over that wasn't my model object.
  • RenderView("Page") is now return View("Page") - Much, much nicer.  Make sure you change those public voids to public ActionResults as well.  Good work on this change!
  • Default.aspx has a codebehind page now - If you're getting blank pages, you probably want to update your Default.aspx that is included in the project template.  Just create a new MVC beta project and you should have it ready to copy into your old project.
  • Update your Web.config file - There are a few new entries:
In compilation/assemblies: <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
In pages/namespaces: <add namespace="System.Web.Mvc.Html" />

Happy coding!

Visual Studio 2008 problems. Breakpoints and crashes.

| No TrackBacks
For the past week or so I've been getting weird problems with Visual Studio 2008.

  • "Could not load breakpoint" - This was a mere nuisance really.  Just a few error dialogs when I loaded our solution.
  • Completely locks up when closing solution, does not save environment - This started happening a few weeks after the breakpoint issue.  Amazingly annoying, since every time I load Visual Studio, I have to set the right startup project, set breakpoints, etc...
  • Closes without an error message when starting 2nd debug session - This is when I got annoyed enough to try to figure out what was happening.  I was losing productivity having to reload and reset my environment every time I wanted to start a new debug session.
Luckily, I found a solution rather quickly.  I don't have the link anymore unfortunately, but all of these problems were fixed by deleting the .suo file in my solution folder.  That kind of a fix should have been obvious to me, but I'm just happy to be back to 100% productivity. :)
Powered by Movable Type 4.21-en

Recent Comments

  • Leandro Nuñez: Hey, thanks for the great share. Is there a way read more
  • Justin: cool plugin. how would you go about creating then wiring read more
  • Anil: Nice plugin. I wanted to add some validation and stop read more
  • reigel: look cool... It would be okay if it can validate read more
  • glompix: @derby We actually do use Subverison for our version control, read more
  • derby: I use xperl, dominos, and titan bar to customize my read more
  • derby: Thanks for the script. I was looking for some AJAX read more
  • A. burton: how do you set up a search for events created read more
  • NANERPUSS: LEXINGTON GOONTUCKY :hfive: read more
  • Matt: This is a great walkthrough. I am also using the read more