Last post May 16, 2017 09:59 AM by Eric Du
May 15, 2017 10:07 PM|Selvakumar Ramachandran|LINK
I am trying to implement Claim based authorization using Policies. I added following code in startup.cs but I am getting an error like AddMvc()/AddPolicy not found. Also I install the Microsoft.Framework.DependencyInjection.IServiceCollection using Nuget
package but still getting the same error. Please let me know how can I fix this issue.
I am using visual studio 2013, Web Api and c#.
public void ConfigureServices(IServiceCollection services)
options.AddPolicy("Project.View", policy => policy.RequireClaim("ProjectView"));
May 16, 2017 09:59 AM|Eric Du|LINK
Hi Selvakumar Ramachandran,
According to this error message, as far as I know, this method(AddMvc()) is belong to this DLL(DependencyInjection).
So my suggestion is add the following code to the head of the page.