【发布时间】:2015-02-27 18:26:31
【问题描述】:
我在 RepositoryPattern 项目中定义了以下接口:
using System.Collections.Generic;
using Domain;
namespace RepositoryPattern
{
public interface IRepository
{
List<Car> GetCars();
}
}
我的 XML 配置的统一部分如下所示:
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<namespace name="RepositoryPattern" />
<container>
<register type="IRepository" mapTo="SqlServerRepository" />
</container>
</unity>
当我运行应用程序时,我收到以下错误:
The type name or alias IRepository could not be resolved. Please check your configuration file and verify this type name.
【问题讨论】:
标签: asp.net-mvc unity-container