vs2010 + MVC 2 + unable to create view

natty's Avatar

natty

24 Sep, 2010 09:27 PM via web

HI,
I was wondering if any one else had had a problem with VS2010 MVC 2 projects not being able to automaticly create a strongly typed view after doing a fluent mapping?

When trying to do the mapping VS2010 doesnt show the Entities in the drop down and even if i manually put the class in it doent build the view correctly.

Cheers
Dan

  1. Support Staff 2 Posted by Paul Batum on 25 Sep, 2010 10:02 PM

    Paul Batum's Avatar

    Sorry I can't offer any assistance in solving your actual problem, but I
    just wanted to mention that in a MVC application you should really think
    about using view models rather than binding your view directly to your
    domain objects. This extra layer of separation gives you a way to reduce the
    amount of logic in your views and address other presentation concerns
    without modifying your domain objects.

    On Fri, Sep 24, 2010 at 4:29 PM, dan gibbs <
    ***@tenderapp.com<tender%***@tenderapp.com>
    > wrote:

  2. 3 Posted by natty on 25 Sep, 2010 10:59 PM

    natty's Avatar

    Thanks, Im just learning MVC so will have a look at view models.
    Dan

  3. 4 Posted by Kila Morton on 27 Sep, 2010 06:38 AM

    Kila Morton's Avatar

    I have had this issue before. In my case I had my models sitting in a separate class library. Whenever I added a new class, it was not immediately picked up when I went to create a strongly typed view using that class. All I did to remedy the situation was to rebuild my model class library after adding additional classes. After rebuilding, the classes display in the drop down the way they are supposed to. This isn't a Fluent NHibernate issue. This is a Visual Studio issue.

    I hope this helps.

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is the number before twelve?