views:

114

answers:

4

When we upgraded MVC beta to MVC RC1 the development webserver that visual studio has suddenly crashed at some point in the application. After some searching I narrowed the bug to this simple line:

if (!helper.ViewData.ContainsKey("SomeString"))

SomeString is at that moment present in the viewData so the if statement should return false

when that line is executed the webserver crashes, no exeption in the program. We see a crash that seems to come from the method ContainsKey. Has someone experienced the same problem? should we roll back our insallation to MVC beta?

A: 

I don't know the answer, but I can tell you how to find it. My experience is that when the development Web server crashes, it is generally because of the stack overflow in your code (or, obviously, code in the framework that you are calling). You can of course get the MVC source code from CodePlex. You should download this, and add it to your solution. Trace into ContainsKey. Use the Visual Studio option to trace into the .NET framework source code, if need be. At some point, you should figure out why the code is reversing.

Craig Stuntz
A: 

I can't give you definitive answer without seeing your error, but I'd guess it's because ViewData.Model became just Model.

See: http://blog.benhall.me.uk/2009/01/aspnet-mvc-rc1-viewdatamodel-becomes.html or http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx

ajma
Both ViewData.Model and Model are supported.
Craig Stuntz
A: 

What exception do you see in the event manager of Windows ? There's some information there which can be useful, I think the application name is Casini

Matthieu
A: 

I have found the problem. The code that executes the ContainsKey method was in an external library. as we upgraded our development machines to RC1 we forgot to upgrade our build server to RC1.So the libraries we referenced were built with a reference to mvc beta. i still find it strange that those errors can occur but that was the problem.

when we upgraded our build server the error was gone.

MichaelD