Hi All,
Within our application we are using the CSLA Framework and we are also using Strongly
Type resources files, the only problem I seem to be having at the moment is
that when the resource file is created it is not being created as Serializable () thus failing when trying use it within the CSLA
Framework. I can manually go and append this attribute, but was hoping that
someone might know a workaround to set this permanently??
Thanks, Tim.
Why would you want the resource file to be serialized across the network? It exists as part of your compiled code/assemblies and so is available on both sides of the data portal by definition. Or so I would expect?
Or are you using a resource file that is not referenced by your actual application, and thus may not be deployed everywhere? In that case you need to think carefully about how to work with it, because it then effectively becomes a database of sorts, and you need to worry about network IO as you make "data calls" to get the resource data. In such a case I would recommend copying the resource data into business objects (probably ReadOnlyBase-derived) and caching those objects on the client so you aren't constantly re-retrieving the data.
I must be misunderstanding your problem. If you look at CSLA, I use My.Resources all over the place, but I didn't have to alter the VS-generated code to make the Resources class serializable. That is because I never maintain a reference to the Resources class - I always just use it through the My namespace. (and the rough equivalent in the C# code - which works basically the same way)
If you are getting a serialization error on a resource object, you must be holding an instance-level reference to that object from within one of your objects. You shouldn't do that, nor should you need to do that.
Must have missed something, have just checked the
designer.vb file for the resource files and there is no serialization attribute
so it must be working. Would I be correct in saying that an object that would
be fully populated with data for the properties before being serialized or
would the other references to the object be serialized as well and used to the remoting
topology?
Copyright (c) Marimer LLC