类型'Startup'已经定义了一个名为'Configuration'的成员,它具有相同的参数类型

Lui*_*cia 5 c# asp.net asp.net-mvc owin

我在我的startup.cs上有这个

using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(xx.yy.Startup))]
namespace xx.yy
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我有这个Startup.Auth.cs

using System;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;

namespace xx.yy
{
    public static class xxAuthentication
    {
        public const String ApplicationCookie = "xxAuthenticationType";
    }

    public partial class Startup
    {
        public void ConfigureAuth(IAppBuilder app)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = xxAuthentication.ApplicationCookie,
                LoginPath = new PathString("/Login"),
                Provider = new CookieAuthenticationProvider(),
                CookieName = "ComisionesCookie",
                CookieHttpOnly = true,
                ExpireTimeSpan = TimeSpan.FromHours(12), // adjust to your needs
            });
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

但是它不能用这个错误编译:

图片

我使用此页面中的代码 http://tech.trailmax.info/2016/03/using-owin-and-active-directory-to-authenticate-users-in-asp-net-mvc-5-application/

Lui*_*cia 7

容易但很难找到,问题是另一个开发人员在项目结构的不同文件夹中创建了一个具有相同签名的startup.cs文件.这里会留下证据,因为它可能对其他开发人员有用