Unity解决异常

时间:2016-09-20 16:22:25

标签: c# .net unity-container

我正在尝试在单元测试中执行以下操作:

IUnityContainer container = new UnityContainer();
DependencyResolver.SetResolver(new UnityDependencyResolver(container));
var test = DependencyResolver.Current.GetService<IUnityContainer>();

我收到以下错误,不确定发生了什么:

  

'System.NullReferenceException'发生在Unity.Mvc5.dll中,但没有   用户代码处理

enter image description here

0 个答案:

没有答案