3

在我的 ASP.NET MVC 3 项目中,我引用了我的 DomainModel 项目。

当我尝试创建强类型视图时会出现问题。在模型类列表中,我的 DomainModel 模型不存在。

我做了以下尝试但没有成功(来自另一个线程):

-remove reference to the library containing the model
-clean project
-close VS
-reopen VS
-rebuild project (VS throws errors)
-re-add reference to the model library
-rebuild project

我也尝试将 VS2010 更新到 VS2010 SP1 同样的问题。

有什么建议吗?

4

1 回答 1

1

好吧,如果您在对话框中看不到模型,请尝试从视图中直接调用它,如下所示:

@model  IEnumerable<Ieagle.WebSelfCare.Models.InvoicingIndex>

如果你有一个 IEnumerable 模型,否则

@model Ieagle.WebSelfCare.Models.Person

如果您无法像这样访问您的模型,那么您可能会在模型中遇到问题

于 2011-06-21T08:52:19.850 回答