Microsoft.AspNet.TestHost异常:未找到方法AddInstance

时间:2016-01-25 17:53:54

标签: c# asp.net asp.net-mvc integration-testing asp.net-core

我正在尝试使用Microsoft.AspNet.TestHost进行集成测试,它使用Microsoft.AspNet.Hosting包,我收到此错误:

  

找不到方法:   “Microsoft.Extensions.DependencyInjection.IServiceCollection   Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.AddInstance(Microsoft.Extensions.DependencyInjection.IServiceCollection,   !! 0)

在调试其加载Microsoft.Extensions.DependencyInjection\1.0.0-rc2-15877这是旧版本。我不确定我做错了什么:

var  _server = new TestServer(TestServer.CreateBuilder().UseStartup< Foo.FrontEnd.Startup>());

我的包裹:

"Microsoft.AspNet.TestHost": "1.0.0-rc1-final",
"Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final",

0 个答案:

没有答案