我按照Microsoft 文档在我的 Web 服务中实现基于策略的授权,但“ConfigureServices”功能没有运行。如果我有什么遗漏,请告诉我。
启动.cs
using Microsoft.Owin;
using Owin;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
[assembly: OwinStartupAttribute(typeof(WebApplication1.Startup))]
namespace WebApplication1
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
public void ConfigureServices(IServiceCollection services)
{
//Some codes here...
}
}
}