Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type 'Startup' already defines a member called 'Configuration' with the same parameter types

I have this on my 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);
        }
    }
}

and I have this 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
            });
        }
    }
}

Howevver it does not compile with this error:

Image

I use the code from this page http://tech.trailmax.info/2016/03/using-owin-and-active-directory-to-authenticate-users-in-asp-net-mvc-5-application/

like image 374
Luis Valencia Avatar asked Jun 03 '16 15:06

Luis Valencia


1 Answers

Easy, but hard to find, the problem is another developer created a startup.cs file with same signature in a different folder in the project structure. Will leave evidence here because it might be useful for another developer

like image 59
Luis Valencia Avatar answered Oct 27 '22 00:10

Luis Valencia