Any possibility of including System.Web.Providers.dll?

Topics: ASP.NET MVC, General
Mar 29, 2012 at 11:39 PM

This is referenced and included by ASP.NET MVC4 and appears to be broken from a backward compatibility standpoint with SqlMembershipProvider.

Would be great to have the source so that we don't have to awkwardly spelunk through with Reflector and try to figure out what is broken and to enable us to work out a fix that might add a compatibility switch.

Thanks,

 

Chris

Apr 2, 2012 at 3:03 AM

I wish there was a button to vote this up. Kinda seems odd these got left out, particularly the newer "universal" providers.

Apr 2, 2012 at 6:59 AM

Why don't you create a ticket in issue tracker and let us vote? :)  Yes, I want it too.

Feb 4, 2013 at 5:11 PM
DefaultSessionStateProvider has a bug that throws a ton of errors.

private void PurgeExpiredSessions()
{
using (SessionEntities entities = ModelHelper.CreateSessionEntities(this.ConnectionString))
{
    foreach (SessionEntity entity in QueryHelper.GetExpiredSessions(entities))
    {
        entities.DeleteObject(entity);
    }
    entities.SaveChanges();
    this.LastSessionPurgeTicks = DateTime.UtcNow.Ticks;
}
}

That runs on multiple instances and when one instance is the first to expire purged sessions the other(s) throw the this error...
System.Data.OptimisticConcurrencyExceptionStore update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

I want to replace that method with ...

private void PurgeExpiredSessions()
{
using (SessionEntities entities = ModelHelper.CreateSessionEntities(this.ConnectionString))
{
    // foreach (SessionEntity entity in QueryHelper.GetExpiredSessions(entities))
    // {
        // entities.DeleteObject(entity);
    // }
    //entities.SaveChanges();

    var sqlCommand = @"DELETE dbo.Sessions WHERE Expires < GETUTCDATE()";
    entities.ExecuteStoreCommand(sqlCommand);
    this.LastSessionPurgeTicks = DateTime.UtcNow.Ticks;
}
}


Please fix it or post it.
Thank you.