ITPub博客

首页 > 应用开发 > > ASP.NET Core 集成测试问题

ASP.NET Core 集成测试问题

作者:ybbyic 时间:2019-09-16 11:19:37 0 删除 编辑

运行 ASP.NET Core 集成测试时出现下面的错误:

System.InvalidOperationException : No method 'public static IWebHostBuilder CreateWebHostBuilder(string[] args)' found on 'AutoGeneratedProgram'. Alternatively, WebApplicationFactory`1 can be extended and 'protected virtual IWebHostBuilder CreateWebHostBuilder()' can be overridden to provide your own IWebHostBuilder instance.

Stack Trace:

at Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory`1.CreateWebHostBuilder()

请问如何解决?

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1769/viewspace-3157970/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    88
  • 访问量
    1014