views:

1112

answers:

2

I like the new Add View dialog that was released with RC1. If you specify a view data class, it generates a scaffolded view for you. It seems to work fine with classes defined in projects within my solution. Some of my domain classes inherit from a base class that is defined in an external assembly (and referenced in my web project). I get an error when I specify one of these domain classes. Visual Studio is reporting a TypeLoadException on the external base class.

I did a little debugging with ProcMon and found that it was looking for the base class DLL in, among other places, a temporary folder. That folder did contain the DLL containing my derived domain model class. I did not see the base class's DLL. So for fun, I copied it there and voila, I could add the view.

Is this a bug?

+1  A: 

Yes this is a bug. Please file it on http://codeplex.com/aspnet

Nick Berardi
Thanks. I see it has already been reported. Thanks. I was going to post my work-around, but I'm having problems logging in.
Decker
A: 

you actually forgot to add the Web.Config file on the View Folder. See this small article : http://www.graytechnology.com/Blog/post/ASPNET-MVC-strongly-typed-view-error-Could-not-load-type.aspx

It got me scratching my head quite a bit as well in my current project! :)

Stephane