【发布时间】:2019-03-07 01:19:51
【问题描述】:
我的 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);
}
}
}
我有这个 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
});
}
}
}
但是编译时不会出现这个错误:
【问题讨论】:
标签: c# asp.net asp.net-mvc owin