Error: multiple types matching the name while Scaffolding ASP.NET Core MVC RC2

Error: multiple types matching the name while Scaffolding ASP.NET Core MVC RC2

我正在根据 n 层架构在 Asp.Net Core RC2 中开发 Web 应用程序。

当我尝试使用脚手架生成 CRUD 控制器和视图时,出现以下错误。

我已将 Models/ViewModels 和 Context/Repository 类 分别分为业务逻辑层和数据访问层。我将 OpenBiz 项目中的这两个层都引用为 nuget 包。但是不能像上面看到的那样执行脚手架。我的架构有问题还是我遗漏了什么?

来自Github的回复:

currently there is an issue with scaffolding, that it doesn't support model classes outside of the current project properly.

As a workaround, you can add the model temporarily to your web project and then move it to the BLL/ DAL projects after scaffolding.

此外他们还打开了 this issue as a bug,引用:

Scaffolding fails if model class is in a dependency (project/ library) of the project on which scaffolding is being run. #251

Project A has a dependeny on Project B. Project B has model class If you try to run scaffolding on Project A by using model class from Project B, it fails with the below error: No model type returned for type:

因此,从 RC2 开始,这是脚手架工具中的错误。