Andy Korneyev Andy Korneyev - 1 year ago 102
ASP.NET (C#) Question

ASP.NET5 beta8 IServiceCollection changes

After updating my project to recently released ASP.NET 5 beta8 I've found that

no longer contains definition for

So previously written code like

services.ConfigureIdentity(o =>
o.Password.RequireUppercase = false;
o.Password.RequireNonLetterOrDigit = false;

services.ConfigureIdentityApplicationCookie(o => o.LoginPath = "/Admin/Users/Login");

can't be compiled anymore.

Google search brings no result, I suppose it is because only one day has passed since beta8 release.

Has anyone found workaround for this? How should identity options be configured in beta8?

Answer Source

The Configure* methods are removed and the Add* methods now accept an Action<TOptions>:

services.AddIdentity<TUser, TRole>(o =>
    o.Password.RequireUppercase = false;
    o.Password.RequireNonLetterOrDigit = false;
    o.Cookies.ApplicationCookie.LoginPath = "/Admin/Users/Login";

Not exactly, but partially related:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download