Handle "Cannot access a closed resource set"
- by Philip
I have a website with several languages in a database. From the database I use ResXResourceWriter to create my .resx files. This is working really good but sometimes I get this exception:
MESSAGE: Cannot access a closed resource set.
SOURCE: mscorlib
FORM:
QUERYSTRING:
TARGETSITE: System.Object GetObject(System.String, Boolean, Boolean)
STACKTRACE: at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
at System.Resources.RuntimeResourceSet.GetString(String key, Boolean ignoreCase)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at System.Linq.Expressions.Expression.ValidateStaticOrInstanceMethod(Expression instance, MethodInfo method)
at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable`1 arguments)
at System.Data.Linq.DataContext.GetMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters)
at System.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters)
at Business.DatabaseModelDataContext.Web_GetMostPlayedEvents(String cultureCode)
at Presentation.Default.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I don't know why this is happening or how to solve it. Does anyone know anything about this?
Thanks,
Philip