我正在尝试使用 Microsoft 的此示例实现会话状态提供程序:
http://msdn.microsoft.com/en-us/library/ms178589.aspx
但我无法编译它,因为 .NET 会抛出此错误:
Error 1
'Project.Session.OdbcSessionStateStore' does not implement inherited abstract member 'System.Web.SessionState.SessionStateStoreProviderBase.CreateNewStoreData(System.Web.HttpContext, int)'
Error 2 'Project.Session.OdbcSessionStateStore.CreateNewStoreData(System.Web.HttpContext, double)' is a new virtual member in sealed class 'Project.Session.OdbcSessionStateStore'
Error 3 'Project.Session.OdbcSessionStateStore.CreateNewStoreData(System.Web.HttpContext, double)': no suitable method found to override
具有 CreateNewStoreData 覆盖的确切代码:
//
// SessionStateProviderBase.CreateNewStoreData
//
public override SessionStateStoreData CreateNewStoreData(
HttpContext context,
double timeout)
{
return new SessionStateStoreData(new SessionStateItemCollection(),
SessionStateUtility.GetSessionStaticObjects(context),
(int)timeout);
}