IServiceCollection类未解析

时间:2016-10-05 19:33:27

标签: c# service asp.net-core

以下是我的Startup.cs课程:

using Microsoft.Owin;
using Owin;
using MapApp.Models;

[assembly: OwinStartup(typeof(MapApp.Startup))]

namespace MapApp
{

public partial class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {

    }

    public void Configuration(IAppBuilder app)
    {
        ConfigureAuth(app);
    } 
}
}

问题是IServiceCollection未解决:红色下划线。

我正在按照链接中的步骤进行操作:https://docs.asp.net/en/latest/tutorials/first-web-api.html#add-a-model-class

1 个答案:

答案 0 :(得分:0)

您正在寻找的骨架是:

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace MapApp
{
    public class Startup
    {
        public void ConfigureServices(IServiceCollection services)
        { 

        }

        public void Configure(IApplicationBuilder app)
        {

        }
    }
}

我不确定是什么引用了Owin程序集。