views:

104

answers:

1

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

A: 

I suspect you closed your DataSource prematurely or didn't close it at all when your program routine is about to end?

Mee
No it is nothing wong with the DataSource, for that I am sure. It must be something with how the .resx are created or that I miss something. But they are always created succesfully but I am getting the exception when they are used in my website.
Philip